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

[flutter_tools] support --extra-gen-snapshot-options everywhere...

[flutter_tools] support --extra-gen-snapshot-options everywhere --extra-front-end-options is specified (#69592)

support --extra-gen-snapshot-options everywhere --extra-front-end-options is specified
parent 406ca0bc
......@@ -10,7 +10,7 @@ import '../resident_runner.dart';
import '../runner/flutter_command.dart';
import 'build.dart';
/// Builds AOT snapshots into platform specific library containers.
/// Builds AOT executables into platform specific library containers.
class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmentArtifacts {
BuildAotCommand({this.aotBuilder}) {
addTreeShakeIconsFlag();
......@@ -18,7 +18,7 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen
addBuildModeFlags();
usesPubOption();
usesDartDefineOption();
usesExtraFrontendOptions();
usesExtraDartFlagOptions();
argParser
..addOption('output-dir', defaultsTo: getAotBuildDirectory())
..addOption('target-platform',
......@@ -32,10 +32,6 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen
allowed: DarwinArch.values.map<String>(getNameForDarwinArch),
help: 'iOS architectures to build.',
)
..addMultiOption(FlutterOptions.kExtraGenSnapshotOptions,
splitCommas: true,
hide: true,
)
..addFlag('bitcode',
defaultsTo: kBitcodeEnabledDefault,
help: 'Build the AOT bundle with bitcode. Requires a compatible bitcode engine.',
......
......@@ -27,7 +27,7 @@ class BuildApkCommand extends BuildSubCommand {
addSplitDebugInfoOption();
addDartObfuscationOption();
usesDartDefineOption();
usesExtraFrontendOptions();
usesExtraDartFlagOptions();
addBundleSkSLPathOption(hide: !verboseHelp);
addEnableExperimentation(hide: !verboseHelp);
addBuildPerformanceFile(hide: !verboseHelp);
......
......@@ -26,7 +26,7 @@ class BuildAppBundleCommand extends BuildSubCommand {
addSplitDebugInfoOption();
addDartObfuscationOption();
usesDartDefineOption();
usesExtraFrontendOptions();
usesExtraDartFlagOptions();
addBundleSkSLPathOption(hide: !verboseHelp);
addBuildPerformanceFile(hide: !verboseHelp);
usesTrackWidgetCreation(verboseHelp: verboseHelp);
......
......@@ -9,7 +9,7 @@ import '../features.dart';
import '../globals.dart' as globals;
import '../project.dart';
import '../reporting/reporting.dart';
import '../runner/flutter_command.dart' show FlutterOptions, FlutterCommandResult;
import '../runner/flutter_command.dart' show FlutterCommandResult;
import 'build.dart';
class BuildBundleCommand extends BuildSubCommand {
......@@ -19,7 +19,7 @@ class BuildBundleCommand extends BuildSubCommand {
usesFilesystemOptions(hide: !verboseHelp);
usesBuildNumberOption();
addBuildModeFlags(verboseHelp: verboseHelp);
usesExtraFrontendOptions();
usesExtraDartFlagOptions();
argParser
..addFlag(
'precompiled',
......@@ -49,10 +49,6 @@ class BuildBundleCommand extends BuildSubCommand {
],
)
..addOption('asset-dir', defaultsTo: getAssetBuildDirectory())
..addMultiOption(FlutterOptions.kExtraGenSnapshotOptions,
splitCommas: true,
hide: true,
)
..addFlag('report-licensed-packages',
help: 'Whether to report the names of all the packages that are included '
"in the application's LICENSE file.",
......
......@@ -177,7 +177,7 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
usesBuildNameOption();
addDartObfuscationOption();
usesDartDefineOption();
usesExtraFrontendOptions();
usesExtraDartFlagOptions();
addEnableExperimentation(hide: !verboseHelp);
addBuildPerformanceFile(hide: !verboseHelp);
addBundleSkSLPathOption(hide: !verboseHelp);
......
......@@ -49,7 +49,7 @@ class BuildIOSFrameworkCommand extends BuildSubCommand {
usesDartDefineOption();
addSplitDebugInfoOption();
addDartObfuscationOption();
usesExtraFrontendOptions();
usesExtraDartFlagOptions();
addNullSafetyModeOptions(hide: !verboseHelp);
addEnableExperimentation(hide: !verboseHelp);
......
......@@ -205,7 +205,7 @@ class RunCommand extends RunCommandBase {
RunCommand({ bool verboseHelp = false }) : super(verboseHelp: verboseHelp) {
requiresPubspecYaml();
usesFilesystemOptions(hide: !verboseHelp);
usesExtraFrontendOptions();
usesExtraDartFlagOptions();
addEnableExperimentation(hide: !verboseHelp);
// By default, the app should to publish the VM service port over mDNS.
......
......@@ -596,11 +596,17 @@ abstract class FlutterCommand extends Command<void> {
);
}
void usesExtraFrontendOptions() {
/// Enables support for the hidden options --extra-front-end-options and
/// --extra-gen-snapshot-options.
void usesExtraDartFlagOptions() {
argParser.addMultiOption(FlutterOptions.kExtraFrontEndOptions,
splitCommas: true,
hide: true,
);
argParser.addMultiOption(FlutterOptions.kExtraGenSnapshotOptions,
splitCommas: true,
hide: true,
);
}
void usesFuchsiaOptions({ bool hide = false }) {
......@@ -664,7 +670,7 @@ abstract class FlutterCommand extends Command<void> {
addTreeShakeIconsFlag();
usesAnalyzeSizeFlag();
usesDartDefineOption();
usesExtraFrontendOptions();
usesExtraDartFlagOptions();
usesPubOption();
usesTargetOption();
usesTrackWidgetCreation(verboseHelp: verboseHelp);
......
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