-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Automatically wire dependencies for native plugins #8891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
mravn-google
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
I presume this is just some plumbing before the later patches which use this? :) |
mit-mit
left a comment
There was a problem hiding this 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
There was a problem hiding this comment.
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/ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed message.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
@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.
84bf1a5 to
f748b6a
Compare
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.yamlfile has aflutter:section containing aplugin:section:The plugin section is currently empty. The
flutter-plugins.propertiesfile 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.