Add hidden options --extra-front-end-options and --extra-gen-snapshot-options to flutter tool (#12219)

This CL introduces 2 hidden options to 'flutter build aot' and 'flutter run' for passing arbitrary arguments to front-end server and to gen_snapshot tool when building and running flutter app in --profile or --release modes.

The ability to pass arbitrary options simplifies various experiments, as it removes the need to change defaults and rebuild flutter engine for every tested configuration.
This commit is contained in:
Alexander Markov
2017-10-03 12:55:53 -07:00
committed by GitHub
parent 528d28ba03
commit 7153dea296
7 changed files with 93 additions and 8 deletions

View File

@@ -54,6 +54,12 @@ class FlutterCommandResult {
final DateTime endTimeOverride;
}
/// Common flutter command line options.
class FlutterOptions {
static const String kExtraFrontEndOptions = 'extra-front-end-options';
static const String kExtraGenSnapshotOptions = 'extra-gen-snapshot-options';
}
abstract class FlutterCommand extends Command<Null> {
@override
FlutterCommandRunner get runner => super.runner;
@@ -149,7 +155,13 @@ abstract class FlutterCommand extends Command<Null> {
: null,
previewDart2: argParser.options.containsKey('preview-dart-2')
? argResults['preview-dart-2']
: false);
: false,
extraFrontEndOptions: argParser.options.containsKey(FlutterOptions.kExtraFrontEndOptions)
? argResults[FlutterOptions.kExtraFrontEndOptions]
: null,
extraGenSnapshotOptions: argParser.options.containsKey(FlutterOptions.kExtraGenSnapshotOptions)
? argResults[FlutterOptions.kExtraGenSnapshotOptions]
: null);
}
void setupApplicationPackages() {