Unverified Commit 9eada88b authored by Liam Appelbe's avatar Liam Appelbe Committed by GitHub

Experimental flags in flutter (#26715)

* exp flags in flutter

* Fix test failures
parent 4fe79442
...@@ -145,7 +145,11 @@ class RunCommand extends RunCommandBase { ...@@ -145,7 +145,11 @@ class RunCommand extends RunCommandBase {
'intended for use in generating automated flutter benchmarks.', 'intended for use in generating automated flutter benchmarks.',
) )
..addOption(FlutterOptions.kExtraFrontEndOptions, hide: true) ..addOption(FlutterOptions.kExtraFrontEndOptions, hide: true)
..addOption(FlutterOptions.kExtraGenSnapshotOptions, hide: true); ..addOption(FlutterOptions.kExtraGenSnapshotOptions, hide: true)
..addMultiOption(FlutterOptions.kEnableExperiment,
splitCommas: true,
hide: true,
);
} }
@override @override
......
...@@ -63,6 +63,7 @@ class FlutterCommandResult { ...@@ -63,6 +63,7 @@ class FlutterCommandResult {
class FlutterOptions { class FlutterOptions {
static const String kExtraFrontEndOptions = 'extra-front-end-options'; static const String kExtraFrontEndOptions = 'extra-front-end-options';
static const String kExtraGenSnapshotOptions = 'extra-gen-snapshot-options'; static const String kExtraGenSnapshotOptions = 'extra-gen-snapshot-options';
static const String kEnableExperiment = 'enable-experiment';
static const String kFileSystemRoot = 'filesystem-root'; static const String kFileSystemRoot = 'filesystem-root';
static const String kFileSystemScheme = 'filesystem-scheme'; static const String kFileSystemScheme = 'filesystem-scheme';
} }
...@@ -389,6 +390,22 @@ abstract class FlutterCommand extends Command<void> { ...@@ -389,6 +390,22 @@ abstract class FlutterCommand extends Command<void> {
'--patch-number (${argResults['patch-number']}) must be an int.', null); '--patch-number (${argResults['patch-number']}) must be an int.', null);
} }
String extraFrontEndOptions =
argParser.options.containsKey(FlutterOptions.kExtraFrontEndOptions)
? argResults[FlutterOptions.kExtraFrontEndOptions]
: null;
if (argParser.options.containsKey(FlutterOptions.kEnableExperiment) &&
argResults[FlutterOptions.kEnableExperiment] != null) {
for (String expFlag in argResults[FlutterOptions.kEnableExperiment]) {
final String flag = '--enable-experiment=' + expFlag;
if (extraFrontEndOptions != null) {
extraFrontEndOptions += ',' + flag;
} else {
extraFrontEndOptions = flag;
}
}
}
return BuildInfo(getBuildMode(), return BuildInfo(getBuildMode(),
argParser.options.containsKey('flavor') argParser.options.containsKey('flavor')
? argResults['flavor'] ? argResults['flavor']
...@@ -410,9 +427,7 @@ abstract class FlutterCommand extends Command<void> { ...@@ -410,9 +427,7 @@ abstract class FlutterCommand extends Command<void> {
baselineDir: argParser.options.containsKey('baseline-dir') baselineDir: argParser.options.containsKey('baseline-dir')
? argResults['baseline-dir'] ? argResults['baseline-dir']
: null, : null,
extraFrontEndOptions: argParser.options.containsKey(FlutterOptions.kExtraFrontEndOptions) extraFrontEndOptions: extraFrontEndOptions,
? argResults[FlutterOptions.kExtraFrontEndOptions]
: null,
extraGenSnapshotOptions: argParser.options.containsKey(FlutterOptions.kExtraGenSnapshotOptions) extraGenSnapshotOptions: argParser.options.containsKey(FlutterOptions.kExtraGenSnapshotOptions)
? argResults[FlutterOptions.kExtraGenSnapshotOptions] ? argResults[FlutterOptions.kExtraGenSnapshotOptions]
: null, : null,
......
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