Skip to content

Manual roll Flutter from 911aa7547ed7 to 043b71954ce7 #8693

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

Merged
merged 10 commits into from
Feb 27, 2025
2 changes: 1 addition & 1 deletion .ci/flutter_master.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
911aa7547ed732052f98b79f7b1584bd137bda43
043b71954ce73f727f3cb6f5ccd549cc005b1310
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import android.util.Log;
import androidx.lifecycle.Lifecycle;
import dev.flutter.plugins.integration_test.IntegrationTestPlugin;
import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
Expand All @@ -19,8 +18,8 @@ public class MainActivity extends FlutterActivity {

@Override
public void configureFlutterEngine(FlutterEngine flutterEngine) {
super.configureFlutterEngine(flutterEngine);
flutterEngine.getPlugins().add(new TestPlugin());
flutterEngine.getPlugins().add(new IntegrationTestPlugin());
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we not need the integration test plugin? was it dead code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a speculative change, but the fact that this wasn't calling super seems suspicious. Normally plugins are registered by the generated registrant.

This wasn't compiling because it's unconditionally using the integration test plugin, but that plugin is a dev dependency. If this doesn't work, I'll need to make this example app have a non-dev dependency on it instead, but that feels wrong.

}

private static class TestPlugin implements FlutterPlugin, ActivityAware {
Expand Down
33 changes: 17 additions & 16 deletions script/tool/lib/src/firebase_test_lab_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,22 +245,23 @@ class FirebaseTestLabCommand extends PackageLoopingCommand {
///
/// Returns true if either gradlew was already present, or the build succeeds.
Future<bool> _ensureGradleWrapperExists(GradleProject project) async {
if (!project.isConfigured()) {
print('Running flutter build apk...');
final String experiment = getStringArg(kEnableExperiment);
final int exitCode = await processRunner.runAndStream(
flutterCommand,
<String>[
'build',
'apk',
'--config-only',
if (experiment.isNotEmpty) '--enable-experiment=$experiment',
],
workingDir: project.androidDirectory);

if (exitCode != 0) {
return false;
}
// Unconditionally re-run build with --debug --config-only, to ensure that
// the project is in a debug state even if it was previously configured.
print('Running flutter build apk...');
final String experiment = getStringArg(kEnableExperiment);
final int exitCode = await processRunner.runAndStream(
flutterCommand,
<String>[
'build',
'apk',
'--debug',
'--config-only',
if (experiment.isNotEmpty) '--enable-experiment=$experiment',
],
workingDir: project.androidDirectory);

if (exitCode != 0) {
return false;
}
return true;
}
Expand Down
46 changes: 44 additions & 2 deletions script/tool/test/firebase_test_lab_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ public class MainActivityTest {
expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[
ProcessCall(
'flutter',
const <String>['build', 'apk', '--debug', '--config-only'],
plugin1
.getExamples()
.first
.platformDirectory(FlutterPlatform.android)
.path),
ProcessCall(
'gcloud',
'auth activate-service-account --key-file=/path/to/key'
Expand All @@ -185,6 +193,14 @@ public class MainActivityTest {
'firebase test android run --type instrumentation --app build/app/outputs/apk/debug/app-debug.apk --test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk --timeout 7m --results-bucket=gs://a_bucket --results-dir=plugins_android_test/plugin1/buildId/testRunId/example/0/ --device model=redfin,version=30 --device model=seoul,version=26'
.split(' '),
'/packages/plugin1/example'),
ProcessCall(
'flutter',
const <String>['build', 'apk', '--debug', '--config-only'],
plugin2
.getExamples()
.first
.platformDirectory(FlutterPlatform.android)
.path),
ProcessCall(
'/packages/plugin2/example/android/gradlew',
'app:assembleAndroidTest -Pverbose=true'.split(' '),
Expand Down Expand Up @@ -245,6 +261,14 @@ public class MainActivityTest {
expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[
ProcessCall(
'flutter',
const <String>['build', 'apk', '--debug', '--config-only'],
plugin
.getExamples()
.first
.platformDirectory(FlutterPlatform.android)
.path),
ProcessCall(
'/packages/plugin/example/android/gradlew',
'app:assembleAndroidTest -Pverbose=true'.split(' '),
Expand Down Expand Up @@ -669,8 +693,12 @@ class MainActivityTest {
orderedEquals(<ProcessCall>[
ProcessCall(
'flutter',
'build apk --config-only'.split(' '),
'/packages/plugin/example/android',
'build apk --debug --config-only'.split(' '),
plugin
.getExamples()
.first
.platformDirectory(FlutterPlatform.android)
.path,
),
ProcessCall(
'/packages/plugin/example/android/gradlew',
Expand Down Expand Up @@ -841,6 +869,20 @@ class MainActivityTest {
expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[
ProcessCall(
'flutter',
const <String>[
'build',
'apk',
'--debug',
'--config-only',
'--enable-experiment=exp1'
],
plugin
.getExamples()
.first
.platformDirectory(FlutterPlatform.android)
.path),
ProcessCall(
'/packages/plugin/example/android/gradlew',
'app:assembleAndroidTest -Pverbose=true -Pextra-front-end-options=--enable-experiment%3Dexp1 -Pextra-gen-snapshot-options=--enable-experiment%3Dexp1'
Expand Down