Unverified Commit efd2ba29 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

Flutter build bundle without --precompiled should always perform a debug build. (#41401)

parent 194256cc
...@@ -89,6 +89,7 @@ class BundleBuilder { ...@@ -89,6 +89,7 @@ class BundleBuilder {
flutterProject: flutterProject, flutterProject: flutterProject,
outputDir: assetDirPath, outputDir: assetDirPath,
depfilePath: depfilePath, depfilePath: depfilePath,
precompiled: precompiledSnapshot,
); );
return; return;
} }
...@@ -150,7 +151,10 @@ Future<void> buildWithAssemble({ ...@@ -150,7 +151,10 @@ Future<void> buildWithAssemble({
@required String mainPath, @required String mainPath,
@required String outputDir, @required String outputDir,
@required String depfilePath, @required String depfilePath,
@required bool precompiled,
}) async { }) async {
// If the precompiled flag was not passed, force us into debug mode.
buildMode = precompiled ? buildMode : BuildMode.debug;
final Environment environment = Environment( final Environment environment = Environment(
projectDir: flutterProject.directory, projectDir: flutterProject.directory,
outputDir: fs.directory(outputDir), outputDir: fs.directory(outputDir),
......
...@@ -21,7 +21,10 @@ class BuildBundleCommand extends BuildSubCommand { ...@@ -21,7 +21,10 @@ class BuildBundleCommand extends BuildSubCommand {
usesBuildNumberOption(); usesBuildNumberOption();
addBuildModeFlags(verboseHelp: verboseHelp); addBuildModeFlags(verboseHelp: verboseHelp);
argParser argParser
..addFlag('precompiled', negatable: false) ..addFlag('precompiled', negatable: false, help: 'If not provided, then '
'a debug build is always provided, regardless of build mode. If provided '
'then release is the default mode.'
)
// This option is still referenced by the iOS build scripts. We should // This option is still referenced by the iOS build scripts. We should
// remove it once we've updated those build scripts. // remove it once we've updated those build scripts.
..addOption('asset-base', help: 'Ignored. Will be removed.', hide: !verboseHelp) ..addOption('asset-base', help: 'Ignored. Will be removed.', hide: !verboseHelp)
......
...@@ -39,6 +39,7 @@ void main() { ...@@ -39,6 +39,7 @@ void main() {
outputDir: 'example', outputDir: 'example',
targetPlatform: TargetPlatform.ios, targetPlatform: TargetPlatform.ios,
depfilePath: 'example.d', depfilePath: 'example.d',
precompiled: false,
); );
expect(fs.file(fs.path.join('example', 'kernel_blob.bin')).existsSync(), true); expect(fs.file(fs.path.join('example', 'kernel_blob.bin')).existsSync(), true);
expect(fs.file(fs.path.join('example', 'LICENSE')).existsSync(), true); expect(fs.file(fs.path.join('example', 'LICENSE')).existsSync(), true);
...@@ -60,6 +61,7 @@ void main() { ...@@ -60,6 +61,7 @@ void main() {
outputDir: 'example', outputDir: 'example',
targetPlatform: TargetPlatform.linux_x64, targetPlatform: TargetPlatform.linux_x64,
depfilePath: 'example.d', depfilePath: 'example.d',
precompiled: false,
), throwsA(isInstanceOf<ToolExit>())); ), throwsA(isInstanceOf<ToolExit>()));
})); }));
} }
......
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