Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(733)

Unified Diff: pkg/dev_compiler/lib/src/compiler/command.dart

Issue 2987393002: enable batch mode for dartdevc tests, also fix status so ddc bots pass (Closed)
Patch Set: fix Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dev_compiler/bin/dartdevc.dart ('k') | pkg/dev_compiler/test/test.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/compiler/command.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/command.dart b/pkg/dev_compiler/lib/src/compiler/command.dart
index dfce39705c426951ebaa9a5bf0e1d53685a5c4fa..854957131594b463c098fbbd037b1ff2b56afaa7 100644
--- a/pkg/dev_compiler/lib/src/compiler/command.dart
+++ b/pkg/dev_compiler/lib/src/compiler/command.dart
@@ -281,3 +281,38 @@ class ForceCompileErrorException extends CompileErrorException {
toString() =>
'\nForce-compilation not successful. Please check static errors.';
}
+
+// TODO(jmesserly): fix this function in analyzer
+List<String> filterUnknownArguments(List<String> args, ArgParser parser) {
+ Set<String> knownOptions = new Set<String>();
+ Set<String> knownAbbreviations = new Set<String>();
+ parser.options.forEach((String name, option) {
+ knownOptions.add(name);
+ String abbreviation = option.abbreviation;
+ if (abbreviation != null) {
+ knownAbbreviations.add(abbreviation);
+ }
+ });
+ List<String> filtered = <String>[];
+ for (int i = 0; i < args.length; i++) {
+ String argument = args[i];
+ if (argument.startsWith('--') && argument.length > 2) {
+ int equalsOffset = argument.lastIndexOf('=');
+ int end = equalsOffset < 0 ? argument.length : equalsOffset;
+ if (knownOptions.contains(argument.substring(2, end))) {
+ filtered.add(argument);
+ }
+ } else if (argument.startsWith('-') && argument.length > 1) {
+ // TODO(jmesserly): fix this line in analyzer
+ // It was discarding abbreviations such as -Da=b
+ // Abbreviations must be 1-character (this is enforced by ArgParser),
+ // so we don't need to use `optionName`
+ if (knownAbbreviations.contains(argument[1])) {
+ filtered.add(argument);
+ }
+ } else {
+ filtered.add(argument);
+ }
+ }
+ return filtered;
+}
« no previous file with comments | « pkg/dev_compiler/bin/dartdevc.dart ('k') | pkg/dev_compiler/test/test.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698