Skip to content

Conversation

@jakobr-google
Copy link
Contributor

@jakobr-google jakobr-google commented Mar 20, 2017

Go through all packages brought in by pub, and write the name and path of every package that is a flutter plugin into flutter-plugins.properties. A package is a plugin if the pubspec.yaml file has a flutter: section containing a plugin: section:

flutter:
  plugin:

The plugin section is currently empty. The flutter-plugins.properties file is updated on every build.

Updated Gradle and Podspec in the new project template to read in flutter-plugins.properties and automatically add dependencies on their native code.

Copy link
Contributor

@mravn-google mravn-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does localEngineOut refer to the --local-engine argument? Then perhaps rename it in the error message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly. -PlocalEngineOut (passed to the Gradle build by Flutter Tools) is the full path to the chosen local engine directory, which is a combination of --local-engine-src-path and --local-engine. If you don't specify --local-engine-src-path, it defaults to $FLUTTER_ROOT/../engine/src, but the Gradle build script has no idea about that. It just gets the resolved path.

Flutter Tools will have verified the --local-engine argument before passing it to Gradle, so you should only see this if you manually specify -PlocalEngineOut to gradle. Or, you know, Gremlins.

@eseidelGoogle
Copy link
Contributor

I presume this is just some plumbing before the later patches which use this? :)

Copy link
Member

@mit-mit mit-mit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a few small nit-level comments

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/YAML/pubspec.yaml file/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change to .flutter-plugins to 1) make it clear you should not edit it, and 2) suggest it's generated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add this file to .gitignore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@jakobr-google
Copy link
Contributor Author

@eseidelGoogle yep! With this PR, everything should be in place to consume plugins. Next up will be the "new plugin" template.

Reads in a mapping of plugin name to path from
flutter-plugins.properties, if that file exists. Plugins are
automatically added as dependent projects of the app, and get a
dependency on flutter.jar.
Go through all packages brought in by pub, and write the name and path
of every one that is a flutter plugin into flutter-plugins.properties.

Update the iOS template Podspec to automatically add pods from
flutter-plugins.properties.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants