Unverified Commit b7773da3 authored by Ryan Macnak's avatar Ryan Macnak Committed by GitHub

Pass build mode-specific bytecode generation options to frontend_server. (#42471)

Fixes various Flutter framework test failures when bytecode is enabled.
parent 163be41d
......@@ -12,6 +12,7 @@ import 'package:flutter_tools/src/base/context.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/context_runner.dart';
import 'package:flutter_tools/src/dart/package_map.dart';
......@@ -146,6 +147,7 @@ Future<void> run(List<String> args) async {
watcher: collector,
ipv6: false,
enableObservatory: collector != null,
buildMode: BuildMode.debug,
precompiledDillFiles: tests,
concurrency: math.max(1, platform.numberOfProcessors - 2),
icudtlPath: fs.path.absolute(argResults[_kOptionIcudtl]),
......
......@@ -308,9 +308,8 @@ class AOTSnapshotter {
extraFrontEndOptions: extraFrontEndOptions,
linkPlatformKernelIn: true,
aot: true,
enableAsserts: buildMode == BuildMode.debug,
buildMode: buildMode,
trackWidgetCreation: trackWidgetCreation,
targetProductVm: buildMode == BuildMode.release,
));
// Write path to frontend_server, since things need to be re-generated when that changes.
......
......@@ -139,7 +139,6 @@ class BuildRunner extends CodeGenerator {
FlutterProject flutterProject, {
String mainPath,
bool linkPlatformKernelIn = false,
bool targetProductVm = false,
bool trackWidgetCreation = false,
List<String> extraFrontEndOptions = const <String> [],
}) async {
......
......@@ -212,10 +212,9 @@ class KernelSnapshot extends Target {
final CompilerOutput output = await compiler.compile(
sdkRoot: artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath, mode: buildMode),
aot: buildMode != BuildMode.debug,
enableAsserts: buildMode == BuildMode.debug,
buildMode: buildMode,
trackWidgetCreation: buildMode == BuildMode.debug,
targetModel: TargetModel.flutter,
targetProductVm: buildMode == BuildMode.release,
outputFilePath: environment.buildDir.childFile('app.dill').path,
packagesPath: packagesPath,
linkPlatformKernelIn: buildMode == BuildMode.release,
......
......@@ -106,7 +106,7 @@ class BundleBuilder {
mainPath: fs.file(mainPath).absolute.path,
outputFilePath: applicationKernelFilePath,
depFilePath: depfilePath,
enableAsserts: buildMode == BuildMode.debug,
buildMode: buildMode,
trackWidgetCreation: trackWidgetCreation,
extraFrontEndOptions: extraFrontEndOptions,
fileSystemRoots: fileSystemRoots,
......
......@@ -8,6 +8,7 @@ import 'artifacts.dart';
import 'base/context.dart';
import 'base/file_system.dart';
import 'base/platform.dart';
import 'build_info.dart';
import 'compile.dart';
import 'dart/package_map.dart';
import 'globals.dart';
......@@ -95,11 +96,10 @@ class CodeGeneratingKernelCompiler implements KernelCompiler {
String outputFilePath,
bool linkPlatformKernelIn = false,
bool aot = false,
bool enableAsserts = false,
@required BuildMode buildMode,
bool causalAsyncStacks = true,
bool trackWidgetCreation,
List<String> extraFrontEndOptions,
bool targetProductVm = false,
// These arguments are currently unused.
String sdkRoot,
String packagesPath,
......@@ -133,11 +133,10 @@ class CodeGeneratingKernelCompiler implements KernelCompiler {
outputFilePath: outputFilePath,
linkPlatformKernelIn: linkPlatformKernelIn,
aot: aot,
enableAsserts: enableAsserts,
buildMode: buildMode,
causalAsyncStacks: causalAsyncStacks,
trackWidgetCreation: trackWidgetCreation,
extraFrontEndOptions: extraFrontEndOptions,
targetProductVm: targetProductVm,
sdkRoot: sdkRoot,
packagesPath: PackageMap.globalGeneratedPackagesPath,
fileSystemRoots: <String>[
......@@ -165,7 +164,7 @@ class CodeGeneratingResidentCompiler implements ResidentCompiler {
/// codegen mode.
static Future<ResidentCompiler> create({
@required FlutterProject flutterProject,
bool enableAsserts = false,
@required BuildMode buildMode,
bool trackWidgetCreation = false,
CompilerMessageConsumer compilerMessageConsumer = printError,
bool unsafePackageSerialization = false,
......@@ -176,7 +175,7 @@ class CodeGeneratingResidentCompiler implements ResidentCompiler {
codeGenerator.updatePackages(flutterProject);
final ResidentCompiler residentCompiler = ResidentCompiler(
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath),
enableAsserts: enableAsserts,
buildMode: buildMode,
trackWidgetCreation: trackWidgetCreation,
packagesPath: PackageMap.globalGeneratedPackagesPath,
fileSystemRoots: <String>[
......
......@@ -9,6 +9,7 @@ import '../asset.dart';
import '../base/common.dart';
import '../base/file_system.dart';
import '../base/platform.dart';
import '../build_info.dart';
import '../bundle.dart';
import '../cache.dart';
import '../codegen.dart';
......@@ -234,7 +235,7 @@ class TestCommand extends FastFlutterCommand {
disableServiceAuthCodes: disableServiceAuthCodes,
ipv6: argResults['ipv6'],
machine: machine,
enableAsserts: true,
buildMode: BuildMode.debug,
trackWidgetCreation: argResults['track-widget-creation'],
updateGoldens: argResults['update-goldens'],
concurrency: jobs,
......
......@@ -15,6 +15,7 @@ import 'base/io.dart';
import 'base/platform.dart';
import 'base/process_manager.dart';
import 'base/terminal.dart';
import 'build_info.dart';
import 'codegen.dart';
import 'convert.dart';
import 'dart/package_map.dart';
......@@ -238,6 +239,31 @@ class PackageUriMapper {
}
}
List<String> _buildModeOptions(BuildMode mode) {
switch (mode) {
case BuildMode.debug:
return <String>[
'-Ddart.vm.profile=false',
'-Ddart.vm.product=false',
'--bytecode-options=source-positions,local-var-info,debugger-stops,instance-field-initializers,keep-unreachable-code,avoid-closure-call-instructions',
'--enable-asserts',
];
case BuildMode.profile:
return <String>[
'-Ddart.vm.profile=true',
'-Ddart.vm.product=false',
'--bytecode-options=source-positions',
];
case BuildMode.release:
return <String>[
'-Ddart.vm.profile=false',
'-Ddart.vm.product=true',
'--bytecode-options=source-positions',
];
}
throw Exception('Unknown BuildMode: $mode');
}
class KernelCompiler {
const KernelCompiler();
......@@ -247,16 +273,15 @@ class KernelCompiler {
String outputFilePath,
String depFilePath,
TargetModel targetModel = TargetModel.flutter,
@required BuildMode buildMode,
bool linkPlatformKernelIn = false,
bool aot = false,
bool enableAsserts = false,
bool causalAsyncStacks = true,
@required bool trackWidgetCreation,
List<String> extraFrontEndOptions,
String packagesPath,
List<String> fileSystemRoots,
String fileSystemScheme,
bool targetProductVm = false,
String initializeFromDill,
String platformDill,
}) async {
......@@ -288,19 +313,13 @@ class KernelCompiler {
'--strong',
'--target=$targetModel',
'-Ddart.developer.causal_async_stacks=$causalAsyncStacks',
if (enableAsserts) '--enable-asserts',
..._buildModeOptions(buildMode),
if (trackWidgetCreation) '--track-widget-creation',
if (!linkPlatformKernelIn) '--no-link-platform',
if (aot) ...<String>[
'--aot',
'--tfa',
],
// If we're not targeting product (release) mode and we're still aot, then
// target profile mode.
if (targetProductVm)
'-Ddart.vm.product=true'
else if (aot)
'-Ddart.vm.profile=true',
if (packagesPath != null) ...<String>[
'--packages',
packagesPath,
......@@ -429,7 +448,7 @@ class _RejectRequest extends _CompilationRequest {
class ResidentCompiler {
ResidentCompiler(
this._sdkRoot, {
bool enableAsserts = false,
@required BuildMode buildMode,
bool causalAsyncStacks = true,
bool trackWidgetCreation = false,
String packagesPath,
......@@ -441,7 +460,7 @@ class ResidentCompiler {
bool unsafePackageSerialization,
List<String> experimentalFlags,
}) : assert(_sdkRoot != null),
_enableAsserts = enableAsserts,
_buildMode = buildMode,
_causalAsyncStacks = causalAsyncStacks,
_trackWidgetCreation = trackWidgetCreation,
_packagesPath = packagesPath,
......@@ -459,7 +478,7 @@ class ResidentCompiler {
}
}
final bool _enableAsserts;
final BuildMode _buildMode;
final bool _causalAsyncStacks;
final bool _trackWidgetCreation;
final String _packagesPath;
......@@ -586,7 +605,7 @@ class ResidentCompiler {
'--packages',
_packagesPath,
],
if (_enableAsserts) '--enable-asserts',
..._buildModeOptions(_buildMode),
if (_trackWidgetCreation) '--track-widget-creation',
if (_fileSystemRoots != null)
for (String root in _fileSystemRoots) ...<String>[
......
......@@ -453,6 +453,7 @@ class IOSSimulator extends Device {
return BundleBuilder().build(
mainPath: mainPath,
precompiledSnapshot: false,
buildMode: buildInfo.mode,
trackWidgetCreation: buildInfo.trackWidgetCreation,
);
}
......
......@@ -42,7 +42,7 @@ class FlutterDevice {
}) : assert(trackWidgetCreation != null),
generator = generator ?? ResidentCompiler(
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath, mode: buildMode),
enableAsserts: buildMode == BuildMode.debug,
buildMode: buildMode,
trackWidgetCreation: trackWidgetCreation,
fileSystemRoots: fileSystemRoots,
fileSystemScheme: fileSystemScheme,
......@@ -67,11 +67,13 @@ class FlutterDevice {
ResidentCompiler generator;
if (flutterProject.hasBuilders) {
generator = await CodeGeneratingResidentCompiler.create(
buildMode: buildMode,
flutterProject: flutterProject,
);
} else {
generator = ResidentCompiler(
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath, mode: buildMode),
buildMode: buildMode,
trackWidgetCreation: trackWidgetCreation,
fileSystemRoots: fileSystemRoots,
fileSystemScheme: fileSystemScheme,
......
......@@ -21,6 +21,7 @@ import '../base/file_system.dart';
import '../base/io.dart';
import '../base/platform.dart';
import '../base/process_manager.dart';
import '../build_info.dart';
import '../compile.dart';
import '../convert.dart';
import '../dart/package_map.dart';
......@@ -86,7 +87,7 @@ FlutterPlatform installHook({
int port = 0,
String precompiledDillPath,
Map<String, String> precompiledDillFiles,
bool enableAsserts = false,
@required BuildMode buildMode,
bool trackWidgetCreation = false,
bool updateGoldens = false,
bool buildTestAssets = false,
......@@ -120,7 +121,7 @@ FlutterPlatform installHook({
port: port,
precompiledDillPath: precompiledDillPath,
precompiledDillFiles: precompiledDillFiles,
enableAsserts: enableAsserts,
buildMode: buildMode,
trackWidgetCreation: trackWidgetCreation,
updateGoldens: updateGoldens,
buildTestAssets: buildTestAssets,
......@@ -260,7 +261,7 @@ class FlutterPlatform extends PlatformPlugin {
this.port,
this.precompiledDillPath,
this.precompiledDillFiles,
this.enableAsserts,
@required this.buildMode,
this.trackWidgetCreation,
this.updateGoldens,
this.buildTestAssets,
......@@ -280,7 +281,7 @@ class FlutterPlatform extends PlatformPlugin {
final int port;
final String precompiledDillPath;
final Map<String, String> precompiledDillFiles;
final bool enableAsserts;
final BuildMode buildMode;
final bool trackWidgetCreation;
final bool updateGoldens;
final bool buildTestAssets;
......@@ -455,7 +456,7 @@ class FlutterPlatform extends PlatformPlugin {
if (precompiledDillPath == null && precompiledDillFiles == null) {
// Lazily instantiate compiler so it is built only if it is actually used.
compiler ??= TestCompiler(enableAsserts, trackWidgetCreation, flutterProject);
compiler ??= TestCompiler(buildMode, trackWidgetCreation, flutterProject);
mainDart = await compiler.compile(mainDart);
if (mainDart == null) {
......
......@@ -15,6 +15,7 @@ import '../base/file_system.dart';
import '../base/io.dart';
import '../base/process_manager.dart';
import '../base/terminal.dart';
import '../build_info.dart';
import '../dart/package_map.dart';
import '../globals.dart';
import '../project.dart';
......@@ -36,7 +37,7 @@ Future<int> runTests(
bool machine = false,
String precompiledDillPath,
Map<String, String> precompiledDillFiles,
bool enableAsserts = false,
@required BuildMode buildMode,
bool trackWidgetCreation = false,
bool updateGoldens = false,
TestWatcher watcher,
......@@ -114,7 +115,7 @@ Future<int> runTests(
serverType: serverType,
precompiledDillPath: precompiledDillPath,
precompiledDillFiles: precompiledDillFiles,
enableAsserts: enableAsserts,
buildMode: buildMode,
trackWidgetCreation: trackWidgetCreation,
updateGoldens: updateGoldens,
buildTestAssets: buildTestAssets,
......
......@@ -37,7 +37,7 @@ class TestCompiler {
///
/// [flutterProject] is the project for which we are running tests.
TestCompiler(
this.enableAsserts,
this.buildMode,
this.trackWidgetCreation,
this.flutterProject,
) : testFilePath = getKernelPathForTransformerOptions(
......@@ -60,7 +60,7 @@ class TestCompiler {
final StreamController<_CompilationRequest> compilerController = StreamController<_CompilationRequest>();
final List<_CompilationRequest> compilationQueue = <_CompilationRequest>[];
final FlutterProject flutterProject;
final bool enableAsserts;
final BuildMode buildMode;
final bool trackWidgetCreation;
final String testFilePath;
......@@ -96,7 +96,7 @@ class TestCompiler {
if (flutterProject.hasBuilders) {
return CodeGeneratingResidentCompiler.create(
flutterProject: flutterProject,
enableAsserts: enableAsserts,
buildMode: buildMode,
trackWidgetCreation: trackWidgetCreation,
compilerMessageConsumer: _reportCompilerMessage,
initializeFromDill: testFilePath,
......@@ -108,7 +108,7 @@ class TestCompiler {
return ResidentCompiler(
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath),
packagesPath: PackageMap.globalPackagesPath,
enableAsserts: enableAsserts,
buildMode: buildMode,
trackWidgetCreation: trackWidgetCreation,
compilerMessageConsumer: _reportCompilerMessage,
initializeFromDill: testFilePath,
......
......@@ -149,6 +149,7 @@ class FlutterTesterDevice extends Device {
assetDirPath: assetDirPath,
applicationKernelFilePath: applicationKernelFilePath,
precompiledSnapshot: false,
buildMode: buildInfo.mode,
trackWidgetCreation: buildInfo.trackWidgetCreation,
);
command.add('--flutter-assets-dir=$assetDirPath');
......
......@@ -128,13 +128,12 @@ flutter_tools:lib/''');
targetModel: anyNamed('targetModel'),
linkPlatformKernelIn: anyNamed('linkPlatformKernelIn'),
aot: anyNamed('aot'),
enableAsserts: anyNamed('enableAsserts'),
buildMode: anyNamed('buildMode'),
trackWidgetCreation: anyNamed('trackWidgetCreation'),
extraFrontEndOptions: anyNamed('extraFrontEndOptions'),
packagesPath: anyNamed('packagesPath'),
fileSystemRoots: anyNamed('fileSystemRoots'),
fileSystemScheme: anyNamed('fileSystemScheme'),
targetProductVm: anyNamed('targetProductVm'),
platformDill: anyNamed('platformDill'),
initializeFromDill: anyNamed('initializeFromDill'),
)).thenAnswer((Invocation invocation) async {
......@@ -153,10 +152,9 @@ flutter_tools:lib/''');
when(mockKernelCompiler.compile(
sdkRoot: anyNamed('sdkRoot'),
aot: anyNamed('aot'),
enableAsserts: anyNamed('enableAsserts'),
buildMode: anyNamed('buildMode'),
trackWidgetCreation: false,
targetModel: anyNamed('targetModel'),
targetProductVm: anyNamed('targetProductVm'),
outputFilePath: anyNamed('outputFilePath'),
depFilePath: anyNamed('depFilePath'),
packagesPath: anyNamed('packagesPath'),
......@@ -178,10 +176,9 @@ flutter_tools:lib/''');
when(mockKernelCompiler.compile(
sdkRoot: anyNamed('sdkRoot'),
aot: anyNamed('aot'),
enableAsserts: anyNamed('enableAsserts'),
buildMode: anyNamed('buildMode'),
trackWidgetCreation: true,
targetModel: anyNamed('targetModel'),
targetProductVm: anyNamed('targetProductVm'),
outputFilePath: anyNamed('outputFilePath'),
depFilePath: anyNamed('depFilePath'),
packagesPath: anyNamed('packagesPath'),
......@@ -391,14 +388,13 @@ class FakeKernelCompiler implements KernelCompiler {
TargetModel targetModel = TargetModel.flutter,
bool linkPlatformKernelIn = false,
bool aot = false,
bool enableAsserts = false,
BuildMode buildMode,
bool causalAsyncStacks = true,
bool trackWidgetCreation,
List<String> extraFrontEndOptions,
String packagesPath,
List<String> fileSystemRoots,
String fileSystemScheme,
bool targetProductVm = false,
String platformDill,
String initializeFromDill,
}) async {
......
......@@ -8,6 +8,7 @@ import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/terminal.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/compile.dart';
import 'package:flutter_tools/src/convert.dart';
import 'package:flutter_tools/src/globals.dart';
......@@ -52,7 +53,7 @@ void main() {
final KernelCompiler kernelCompiler = await kernelCompilerFactory.create(null);
final CompilerOutput output = await kernelCompiler.compile(sdkRoot: '/path/to/sdkroot',
mainPath: '/path/to/main.dart',
enableAsserts: true,
buildMode: BuildMode.debug,
trackWidgetCreation: false,
);
......@@ -76,7 +77,7 @@ void main() {
final KernelCompiler kernelCompiler = await kernelCompilerFactory.create(null);
final CompilerOutput output = await kernelCompiler.compile(sdkRoot: '/path/to/sdkroot',
mainPath: '/path/to/main.dart',
enableAsserts: true,
buildMode: BuildMode.debug,
trackWidgetCreation: false,
);
......@@ -103,7 +104,7 @@ void main() {
final CompilerOutput output = await kernelCompiler.compile(
sdkRoot: '/path/to/sdkroot',
mainPath: '/path/to/main.dart',
enableAsserts: true,
buildMode: BuildMode.debug,
trackWidgetCreation: false,
);
expect(mockFrontendServerStdIn.getAndClear(), isEmpty);
......
......@@ -9,6 +9,7 @@ import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/terminal.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/compile.dart';
import 'package:flutter_tools/src/convert.dart';
import 'package:flutter_tools/src/globals.dart';
......@@ -28,7 +29,7 @@ void main() {
StreamController<String> stdErrStreamController;
setUp(() {
generator = ResidentCompiler('sdkroot');
generator = ResidentCompiler('sdkroot', buildMode: BuildMode.debug);
mockProcessManager = MockProcessManager();
mockFrontendServer = MockProcess();
mockFrontendServerStdIn = MockStdIn();
......
......@@ -10,6 +10,7 @@ import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/terminal.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/compile.dart';
import 'package:flutter_tools/src/convert.dart';
import 'package:flutter_tools/src/globals.dart';
......@@ -29,7 +30,7 @@ void main() {
StreamController<String> stdErrStreamController;
setUp(() {
generator = ResidentCompiler('sdkroot');
generator = ResidentCompiler('sdkroot', buildMode: BuildMode.debug);
mockProcessManager = MockProcessManager();
mockFrontendServer = MockProcess();
mockFrontendServerStdIn = MockStdIn();
......
......@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/base/common.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/platform.dart';
......@@ -18,13 +19,13 @@ import '../src/context.dart';
void main() {
group('FlutterPlatform', () {
testUsingContext('ensureConfiguration throws an error if an explicitObservatoryPort is specified and more than one test file', () async {
final FlutterPlatform flutterPlatform = FlutterPlatform(shellPath: '/', explicitObservatoryPort: 1234);
final FlutterPlatform flutterPlatform = FlutterPlatform(buildMode: BuildMode.debug, shellPath: '/', explicitObservatoryPort: 1234);
flutterPlatform.loadChannel('test1.dart', MockSuitePlatform());
expect(() => flutterPlatform.loadChannel('test2.dart', MockSuitePlatform()), throwsA(isA<ToolExit>()));
});
testUsingContext('ensureConfiguration throws an error if a precompiled entrypoint is specified and more that one test file', () {
final FlutterPlatform flutterPlatform = FlutterPlatform(shellPath: '/', precompiledDillPath: 'example.dill');
final FlutterPlatform flutterPlatform = FlutterPlatform(buildMode: BuildMode.debug, shellPath: '/', precompiledDillPath: 'example.dill');
flutterPlatform.loadChannel('test1.dart', MockSuitePlatform());
expect(() => flutterPlatform.loadChannel('test2.dart', MockSuitePlatform()), throwsA(isA<ToolExit>()));
});
......@@ -86,12 +87,14 @@ void main() {
testUsingContext('installHook creates a FlutterPlatform', () {
expect(() => installHook(
buildMode: BuildMode.debug,
shellPath: 'abc',
enableObservatory: false,
startPaused: true,
), throwsA(isA<AssertionError>()));
expect(() => installHook(
buildMode: BuildMode.debug,
shellPath: 'abc',
enableObservatory: false,
startPaused: false,
......@@ -109,7 +112,7 @@ void main() {
port: 100,
precompiledDillPath: 'def',
precompiledDillFiles: expectedPrecompiledDillFiles,
enableAsserts: true,
buildMode: BuildMode.debug,
trackWidgetCreation: true,
updateGoldens: true,
buildTestAssets: true,
......@@ -131,7 +134,7 @@ void main() {
expect(flutterPlatform.explicitObservatoryPort, equals(200));
expect(flutterPlatform.precompiledDillPath, equals('def'));
expect(flutterPlatform.precompiledDillFiles, expectedPrecompiledDillFiles);
expect(flutterPlatform.enableAsserts, equals(true));
expect(flutterPlatform.buildMode, equals(BuildMode.debug));
expect(flutterPlatform.trackWidgetCreation, equals(true));
expect(flutterPlatform.updateGoldens, equals(true));
expect(flutterPlatform.buildTestAssets, equals(true));
......@@ -153,6 +156,7 @@ class MockHttpServer extends Mock implements HttpServer {}
// Uses a mock HttpServer. We don't want to bind random ports in our CI hosts.
class TestFlutterPlatform extends FlutterPlatform {
TestFlutterPlatform() : super(
buildMode: BuildMode.debug,
shellPath: '/',
precompiledDillPath: 'example.dill',
host: InternetAddress.loopbackIPv6,
......
......@@ -3,6 +3,7 @@
// found in the LICENSE file.
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/compile.dart';
import 'package:flutter_tools/src/project.dart';
import 'package:flutter_tools/src/test/test_compiler.dart';
......@@ -25,7 +26,7 @@ void main() {
fs.file('test/foo.dart').createSync(recursive: true);
residentCompiler = MockResidentCompiler();
testCompiler = FakeTestCompiler(
true,
BuildMode.debug,
false,
FlutterProject.current(),
residentCompiler,
......@@ -76,11 +77,11 @@ void main() {
/// Override the creation of the Resident Compiler to simplify testing.
class FakeTestCompiler extends TestCompiler {
FakeTestCompiler(
bool enableAsserts,
BuildMode buildMode,
bool trackWidgetCreation,
FlutterProject flutterProject,
this.residentCompiler,
) : super(enableAsserts, trackWidgetCreation, flutterProject);
) : super(buildMode, trackWidgetCreation, flutterProject);
final MockResidentCompiler residentCompiler;
......
......@@ -134,7 +134,10 @@ void main() {
mockArtifacts = MockArtifacts();
final String artifactPath = fs.path.join(flutterRoot, 'artifact');
fs.file(artifactPath).createSync(recursive: true);
when(mockArtifacts.getArtifactPath(any)).thenReturn(artifactPath);
when(mockArtifacts.getArtifactPath(
any,
mode: anyNamed('mode')
)).thenReturn(artifactPath);
mockKernelCompiler = MockKernelCompiler();
});
......@@ -170,7 +173,7 @@ Hello!
mainPath: anyNamed('mainPath'),
outputFilePath: anyNamed('outputFilePath'),
depFilePath: anyNamed('depFilePath'),
enableAsserts: anyNamed('enableAsserts'),
buildMode: BuildMode.debug,
trackWidgetCreation: anyNamed('trackWidgetCreation'),
extraFrontEndOptions: anyNamed('extraFrontEndOptions'),
fileSystemRoots: anyNamed('fileSystemRoots'),
......
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