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 { ...@@ -226,6 +226,8 @@ class KernelSnapshot extends Target {
trackWidgetCreation: trackWidgetCreation && buildMode != BuildMode.release, trackWidgetCreation: trackWidgetCreation && buildMode != BuildMode.release,
targetModel: targetModel, targetModel: targetModel,
outputFilePath: environment.buildDir.childFile('app.dill').path, outputFilePath: environment.buildDir.childFile('app.dill').path,
initializeFromDill: buildMode.isPrecompiled ? null :
environment.buildDir.childFile('app.dill').path,
packagesPath: packagesFile.path, packagesPath: packagesFile.path,
linkPlatformKernelIn: forceLinkPlatform || buildMode.isPrecompiled, linkPlatformKernelIn: forceLinkPlatform || buildMode.isPrecompiled,
mainPath: targetFileAbsolute, mainPath: targetFileAbsolute,
......
...@@ -315,6 +315,7 @@ class KernelCompiler { ...@@ -315,6 +315,7 @@ class KernelCompiler {
fileSystemScheme, fileSystemScheme,
], ],
if (initializeFromDill != null) ...<String>[ if (initializeFromDill != null) ...<String>[
'--incremental',
'--initialize-from-dill', '--initialize-from-dill',
initializeFromDill, initializeFromDill,
], ],
......
...@@ -257,6 +257,9 @@ void main() { ...@@ -257,6 +257,9 @@ void main() {
'$build/app.dill', '$build/app.dill',
'--depfile', '--depfile',
'$build/kernel_snapshot.d', '$build/kernel_snapshot.d',
'--incremental',
'--initialize-from-dill',
'$build/app.dill',
'--verbosity=error', '--verbosity=error',
'file:///lib/main.dart', 'file:///lib/main.dart',
], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey $build/app.dill 0\n'), ], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey $build/app.dill 0\n'),
...@@ -295,6 +298,9 @@ void main() { ...@@ -295,6 +298,9 @@ void main() {
'$build/app.dill', '$build/app.dill',
'--depfile', '--depfile',
'$build/kernel_snapshot.d', '$build/kernel_snapshot.d',
'--incremental',
'--initialize-from-dill',
'$build/app.dill',
'--verbosity=error', '--verbosity=error',
'file:///lib/main.dart', 'file:///lib/main.dart',
], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey $build/app.dill 0\n'), ], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey $build/app.dill 0\n'),
...@@ -348,6 +354,9 @@ void main() { ...@@ -348,6 +354,9 @@ void main() {
'$build/app.dill', '$build/app.dill',
'--depfile', '--depfile',
'$build/kernel_snapshot.d', '$build/kernel_snapshot.d',
'--incremental',
'--initialize-from-dill',
'$build/app.dill',
'--verbosity=error', '--verbosity=error',
'file:///lib/main.dart', 'file:///lib/main.dart',
], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey /build/653e11a8e6908714056a57cd6b4f602a/app.dill 0\n'), ], 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