-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[package_info] Support the v2 Android embedder (with e2e tests) #2160
[package_info] Support the v2 Android embedder (with e2e tests) #2160
Conversation
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!
I left a few non-blocking nits/questions. The one thing we should figure before landing is whether we need to bump the minimally required flutter SDK.
@@ -1 +1,2 @@ | |||
org.gradle.jvmargs=-Xmx1536M | |||
android.enableJetifier=true |
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.
What's the affect of adding this to a plugin's gradle file? Does this setting gets propagated to all apps who are using the plugin?
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.
Based on the name, I'm hoping that enableJetifier
does not imply enableAndroidX
, so it should reduce compilation errors without causing compilation errors.
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.
I don't think this has any meaning without enableAndroidX
, and if it does I think it would also implicitly turn AndroidX on. If AndroidX is enabled and this flag is true, Gradle will attempt to run Jetifier to convert any support references to AndroidX ones. I'm not sure how Gradle handles just this flag with enableAndroidX
being undefined.
I'm pretty sure that putting this here means that this subproject and only this subproject would be affected, but there may be some weirdness here on account of our build system.
void main() { | ||
InstrumentationAdapterFlutterBinding.ensureInitialized(); | ||
|
||
testWidgets('fromPlatform', (WidgetTester tester) async { |
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.
Curious - does this always needs to be a testWidgets
if we're using the instrumentation adapter?
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.
Currently the e2e adapter doesn't hook at a low enough level to catch calls to test(), but that could be improved in the future. When I talked to Ian about it, it didn't seem like a priority.
packages/package_info/example/android/app/src/main/AndroidManifest.xml
Outdated
Show resolved
Hide resolved
…n up AndroidManifest.xml
super.onCreate(savedInstanceState); | ||
GeneratedPluginRegistrant.registerWith(this); | ||
public void configureFlutterEngine(FlutterEngine flutterEngine) { | ||
flutterEngine.getPlugins().add(new PackageInfoPlugin()); |
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.
nit: add a TODO to remove this once the generated registrant for the v2 embedder is on stable
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, we should probably make this change in the battery plugin also
…ter#2160) * Migrate the package_info plugin to use the new embedder. * Upgraded to AndroidX. * Added a unit test. * Added Firebase Test Lab compatible e2e testing (including changes to Dockerfile and .cirrus.yml)
…ter#2160) * Migrate the package_info plugin to use the new embedder. * Upgraded to AndroidX. * Added a unit test. * Added Firebase Test Lab compatible e2e testing (including changes to Dockerfile and .cirrus.yml)
Description
This PR is intended to serve as an example of how to do same-isolate e2e testing of plugins.
To e2e test low-level plugin APIs using Flutter driver:
To e2e test the example app itself:
When using flutter driver, to change the binding update the intent filter in AndroidManifest.xml.
To e2e test on a local emulator using Android instrumentation:
To e2e test using Firebase test lab, follow the instructions on the e2e README or let CI plugin_tools do it for you.
Known issues
Related Issues
Fixes flutter/flutter#41843
For a full list of migrations, see https://github.com/flutter/flutter/projects/59