Unverified Commit b1410c2c authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

Ensure flutter run build is done in incremental mode. (#107184)

* Ensure build is done in incremental mode.

This allows for faster bootstrapping of the compiler from previously created dill file.

Fixes https://github.com/flutter/flutter/issues/107183

* Avoid initializeFromDill in aot mode

* Update tests
parent 043f0f7e
......@@ -226,6 +226,8 @@ class KernelSnapshot extends Target {
trackWidgetCreation: trackWidgetCreation && buildMode != BuildMode.release,
targetModel: targetModel,
outputFilePath: environment.buildDir.childFile('app.dill').path,
initializeFromDill: buildMode.isPrecompiled ? null :
environment.buildDir.childFile('app.dill').path,
packagesPath: packagesFile.path,
linkPlatformKernelIn: forceLinkPlatform || buildMode.isPrecompiled,
mainPath: targetFileAbsolute,
......
......@@ -315,6 +315,7 @@ class KernelCompiler {
fileSystemScheme,
],
if (initializeFromDill != null) ...<String>[
'--incremental',
'--initialize-from-dill',
initializeFromDill,
],
......
......@@ -257,6 +257,9 @@ void main() {
'$build/app.dill',
'--depfile',
'$build/kernel_snapshot.d',
'--incremental',
'--initialize-from-dill',
'$build/app.dill',
'--verbosity=error',
'file:///lib/main.dart',
], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey $build/app.dill 0\n'),
......@@ -295,6 +298,9 @@ void main() {
'$build/app.dill',
'--depfile',
'$build/kernel_snapshot.d',
'--incremental',
'--initialize-from-dill',
'$build/app.dill',
'--verbosity=error',
'file:///lib/main.dart',
], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey $build/app.dill 0\n'),
......@@ -348,6 +354,9 @@ void main() {
'$build/app.dill',
'--depfile',
'$build/kernel_snapshot.d',
'--incremental',
'--initialize-from-dill',
'$build/app.dill',
'--verbosity=error',
'file:///lib/main.dart',
], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey /build/653e11a8e6908714056a57cd6b4f602a/app.dill 0\n'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment