[flutter_tool] Reland: support --fast-start for Android applications (as an opt-in) (#46140)
This commit is contained in:
@@ -527,6 +527,7 @@ class AndroidDevice extends Device {
|
||||
androidBuildInfo: AndroidBuildInfo(
|
||||
debuggingOptions.buildInfo,
|
||||
targetArchs: <AndroidArch>[androidArch],
|
||||
fastStart: debuggingOptions.fastStart
|
||||
),
|
||||
);
|
||||
// Package has been built, so we can get the updated application ID and
|
||||
@@ -643,6 +644,9 @@ class AndroidDevice extends Device {
|
||||
@override
|
||||
bool get supportsHotRestart => true;
|
||||
|
||||
@override
|
||||
bool get supportsFastStart => true;
|
||||
|
||||
@override
|
||||
Future<bool> stopApp(AndroidApk app) {
|
||||
final List<String> command = adbCommandForDevice(<String>['shell', 'am', 'force-stop', app.id]);
|
||||
|
||||
@@ -331,6 +331,9 @@ Future<void> buildGradleApp({
|
||||
// Don't use settings.gradle from the current project since it includes the plugins as subprojects.
|
||||
command.add('--settings-file=settings_aar.gradle');
|
||||
}
|
||||
if (androidBuildInfo.fastStart) {
|
||||
command.add('-Pfast-start=true');
|
||||
}
|
||||
command.add(assembleTask);
|
||||
|
||||
GradleHandledError detectedGradleError;
|
||||
|
||||
Reference in New Issue
Block a user