Skip to content

Commit b1410c2

Browse files
authored
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 flutter/flutter#107183 * Avoid initializeFromDill in aot mode * Update tests
1 parent 043f0f7 commit b1410c2

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

packages/flutter_tools/lib/src/build_system/targets/common.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ class KernelSnapshot extends Target {
226226
trackWidgetCreation: trackWidgetCreation && buildMode != BuildMode.release,
227227
targetModel: targetModel,
228228
outputFilePath: environment.buildDir.childFile('app.dill').path,
229+
initializeFromDill: buildMode.isPrecompiled ? null :
230+
environment.buildDir.childFile('app.dill').path,
229231
packagesPath: packagesFile.path,
230232
linkPlatformKernelIn: forceLinkPlatform || buildMode.isPrecompiled,
231233
mainPath: targetFileAbsolute,

packages/flutter_tools/lib/src/compile.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ class KernelCompiler {
315315
fileSystemScheme,
316316
],
317317
if (initializeFromDill != null) ...<String>[
318+
'--incremental',
318319
'--initialize-from-dill',
319320
initializeFromDill,
320321
],

packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ void main() {
257257
'$build/app.dill',
258258
'--depfile',
259259
'$build/kernel_snapshot.d',
260+
'--incremental',
261+
'--initialize-from-dill',
262+
'$build/app.dill',
260263
'--verbosity=error',
261264
'file:///lib/main.dart',
262265
], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey $build/app.dill 0\n'),
@@ -295,6 +298,9 @@ void main() {
295298
'$build/app.dill',
296299
'--depfile',
297300
'$build/kernel_snapshot.d',
301+
'--incremental',
302+
'--initialize-from-dill',
303+
'$build/app.dill',
298304
'--verbosity=error',
299305
'file:///lib/main.dart',
300306
], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey $build/app.dill 0\n'),
@@ -348,6 +354,9 @@ void main() {
348354
'$build/app.dill',
349355
'--depfile',
350356
'$build/kernel_snapshot.d',
357+
'--incremental',
358+
'--initialize-from-dill',
359+
'$build/app.dill',
351360
'--verbosity=error',
352361
'file:///lib/main.dart',
353362
], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey /build/653e11a8e6908714056a57cd6b4f602a/app.dill 0\n'),

0 commit comments

Comments
 (0)