From aa333fda25bce54eeab37b56432ce97d299c2541 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 6 Nov 2019 12:21:41 -0800 Subject: [PATCH] link platform should be true for profile (#44279) --- .../flutter_tools/lib/src/build_system/targets/dart.dart | 4 ++-- .../test/general.shard/build_system/targets/dart_test.dart | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/lib/src/build_system/targets/dart.dart b/packages/flutter_tools/lib/src/build_system/targets/dart.dart index d3f482b2dd..4a04972237 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/dart.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/dart.dart @@ -168,13 +168,13 @@ class KernelSnapshot extends Target { platform: targetPlatform, mode: buildMode, ), - aot: buildMode != BuildMode.debug, + aot: buildMode.isPrecompiled, buildMode: buildMode, trackWidgetCreation: trackWidgetCreation && buildMode == BuildMode.debug, targetModel: targetModel, outputFilePath: environment.buildDir.childFile('app.dill').path, packagesPath: packagesPath, - linkPlatformKernelIn: buildMode == BuildMode.release, + linkPlatformKernelIn: buildMode.isPrecompiled, mainPath: targetFileAbsolute, depFilePath: environment.buildDir.childFile('kernel_snapshot.d').path, ); diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart index 51da62a302..076b636982 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart @@ -159,6 +159,7 @@ flutter_tools:lib/'''); depFilePath: anyNamed('depFilePath'), packagesPath: anyNamed('packagesPath'), mainPath: anyNamed('mainPath'), + linkPlatformKernelIn: anyNamed('linkPlatformKernelIn'), )).thenAnswer((Invocation _) async { return const CompilerOutput('example', 0, []); }); @@ -183,11 +184,14 @@ flutter_tools:lib/'''); depFilePath: anyNamed('depFilePath'), packagesPath: anyNamed('packagesPath'), mainPath: anyNamed('mainPath'), + linkPlatformKernelIn: false, )).thenAnswer((Invocation _) async { return const CompilerOutput('example', 0, []); }); - await const KernelSnapshot().build(androidEnvironment..defines[kTrackWidgetCreation] = 'false'); + await const KernelSnapshot().build(androidEnvironment + ..defines[kBuildMode] = 'debug' + ..defines[kTrackWidgetCreation] = 'false'); }, overrides: { KernelCompilerFactory: () => MockKernelCompilerFactory(), })); @@ -207,6 +211,7 @@ flutter_tools:lib/'''); depFilePath: anyNamed('depFilePath'), packagesPath: anyNamed('packagesPath'), mainPath: anyNamed('mainPath'), + linkPlatformKernelIn: false, )).thenAnswer((Invocation _) async { return const CompilerOutput('example', 0, []); });