mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Flutter build bundle without --precompiled should always perform a debug build. (#41401)
This commit is contained in:
parent
194256cc3c
commit
efd2ba296b
@ -89,6 +89,7 @@ class BundleBuilder {
|
||||
flutterProject: flutterProject,
|
||||
outputDir: assetDirPath,
|
||||
depfilePath: depfilePath,
|
||||
precompiled: precompiledSnapshot,
|
||||
);
|
||||
return;
|
||||
}
|
||||
@ -150,7 +151,10 @@ Future<void> buildWithAssemble({
|
||||
@required String mainPath,
|
||||
@required String outputDir,
|
||||
@required String depfilePath,
|
||||
@required bool precompiled,
|
||||
}) async {
|
||||
// If the precompiled flag was not passed, force us into debug mode.
|
||||
buildMode = precompiled ? buildMode : BuildMode.debug;
|
||||
final Environment environment = Environment(
|
||||
projectDir: flutterProject.directory,
|
||||
outputDir: fs.directory(outputDir),
|
||||
|
||||
@ -21,7 +21,10 @@ class BuildBundleCommand extends BuildSubCommand {
|
||||
usesBuildNumberOption();
|
||||
addBuildModeFlags(verboseHelp: verboseHelp);
|
||||
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
|
||||
// remove it once we've updated those build scripts.
|
||||
..addOption('asset-base', help: 'Ignored. Will be removed.', hide: !verboseHelp)
|
||||
|
||||
@ -39,6 +39,7 @@ void main() {
|
||||
outputDir: 'example',
|
||||
targetPlatform: TargetPlatform.ios,
|
||||
depfilePath: 'example.d',
|
||||
precompiled: false,
|
||||
);
|
||||
expect(fs.file(fs.path.join('example', 'kernel_blob.bin')).existsSync(), true);
|
||||
expect(fs.file(fs.path.join('example', 'LICENSE')).existsSync(), true);
|
||||
@ -60,6 +61,7 @@ void main() {
|
||||
outputDir: 'example',
|
||||
targetPlatform: TargetPlatform.linux_x64,
|
||||
depfilePath: 'example.d',
|
||||
precompiled: false,
|
||||
), throwsA(isInstanceOf<ToolExit>()));
|
||||
}));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user