Expose enable-experiment in Flutter drive (#66311)

This commit is contained in:
Emmanuel Garcia
2020-09-23 10:38:02 -07:00
committed by GitHub
parent 1a9ea39ad7
commit fc1e764264
3 changed files with 102 additions and 5 deletions

View File

@@ -50,9 +50,11 @@ import 'run.dart';
/// successful the exit code will be `0`. Otherwise, you will see a non-zero
/// exit code.
class DriveCommand extends RunCommandBase {
DriveCommand() {
DriveCommand({
bool verboseHelp = false,
}) {
requiresPubspecYaml();
addEnableExperimentation(hide: !verboseHelp);
argParser
..addFlag('keep-app-running',
defaultsTo: null,
@@ -322,7 +324,18 @@ $ex
}
try {
await testRunner(<String>[testFile], environment);
await testRunner(
<String>[
if (buildInfo.dartExperiments.isNotEmpty)
'--enable-experiment=${buildInfo.dartExperiments.join(',')}',
if (buildInfo.nullSafetyMode == NullSafetyMode.sound)
'--sound-null-safety',
if (buildInfo.nullSafetyMode == NullSafetyMode.unsound)
'--no-sound-null-safety',
testFile,
],
environment,
);
} on Exception catch (error, stackTrace) {
if (error is ToolExit) {
rethrow;