Fix default in gardening tools

test.py was changed, this makes the gardening scripts use the same default for
strong-mode/no-preview-dart-2

Change-Id: I974e288a95811ed8980f0ffbe2d8a9135fbfb5f0
Reviewed-on: https://dart-review.googlesource.com/63987
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This commit is contained in:
Sigmund Cherem 2018-07-09 17:42:38 +00:00 committed by commit-bot@chromium.org
parent 007dcd415d
commit bab152a0a9
2 changed files with 8 additions and 7 deletions

View file

@ -46,7 +46,7 @@ final _variables = {
}),
"minified": new _Variable.bool((c) => c.minified),
"mode": new _Variable((c) => c.mode, Mode.names),
"preview_dart_2": new _Variable.bool((c) => c.previewDart2),
"no_preview_dart_2": new _Variable.bool((c) => c.noPreviewDart2),
"runtime": new _Variable(_runtimeName, Runtime.names),
"spec_parser": new _Variable.bool((c) => c.compiler == Compiler.specParser),
"strong": new _Variable.bool((c) => c.strong),

View file

@ -28,7 +28,7 @@ class Configuration {
final bool enableAsserts;
final bool hotReload;
final bool hotReloadRollback;
final bool previewDart2;
final bool noPreviewDart2;
final List<String> selectors;
Configuration(
@ -53,17 +53,18 @@ class Configuration {
this.enableAsserts,
this.hotReload,
this.hotReloadRollback,
this.previewDart2,
this.noPreviewDart2,
this.selectors);
static Configuration getFromJson(dynamic json) {
var isStrong = !(json["no_preview_dart_2"] ?? false);
return new Configuration(
json["mode"],
json["arch"],
json["compiler"],
json["runtime"],
json["checked"],
json["strong"],
isStrong,
json["host_checked"],
json["minified"],
json["csp"],
@ -79,7 +80,7 @@ class Configuration {
json["enable_asserts"] ?? false,
json["hot_reload"] ?? false,
json["hot_reload_rollback"] ?? false,
json["preview_dart_2"] ?? false,
!isStrong,
json["selectors"].cast<String>() ?? <String>[]);
}
@ -107,7 +108,7 @@ class Configuration {
_boolToArg("enable-asserts", enableAsserts),
_boolToArg("hot-reload", hotReload),
_boolToArg("hot-reload-rollback", hotReloadRollback),
_boolToArg("preview-dart-2", previewDart2)
_boolToArg("no-preview-dart-2", noPreviewDart2)
].where((x) => x != null).toList();
if (includeSelectors && selectors != null && selectors.length > 0) {
args.addAll(selectors);
@ -119,7 +120,7 @@ class Configuration {
return "$mode;$arch;$compiler;$runtime;$checked;$strong;$hostChecked;"
"$minified;$csp;$fasta;$system;$vmOptions;$useSdk;$builderTag;$fastStartup;"
"$dart2JsWithKernel;$dart2JsOldFrontend;$enableAsserts;$hotReload;"
"$hotReloadRollback;$previewDart2;$selectors";
"$hotReloadRollback;$noPreviewDart2;$selectors";
}
String _stringToArg(String name, String value) {