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

Unified Diff: bin/dartdevc.dart

Issue 1884073003: Add bazel worker support to the dev compiler. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: code review updates Created 4 years, 8 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 | « no previous file | lib/src/compiler/command.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/dartdevc.dart
diff --git a/bin/dartdevc.dart b/bin/dartdevc.dart
index 6be7a969f9cb54b4436749b15489cd80169cf8f8..2246a9ce40820aa767ef346e8ae9d03e2f067595 100755
--- a/bin/dartdevc.dart
+++ b/bin/dartdevc.dart
@@ -40,39 +40,27 @@ import 'package:args/command_runner.dart';
import 'package:dev_compiler/src/compiler/command.dart';
main(List<String> args) async {
+ args = _preprocessArgs(args);
+
var runner = new CommandRunner('dartdevc', 'Dart Development Compiler');
runner.addCommand(new CompileCommand());
try {
await runner.run(args);
- } on UsageException catch (e) {
- // Incorrect usage, input file not found, etc.
- print(e);
- exit(64);
- } on CompileErrorException catch (e) {
- // Code has error(s) and failed to compile.
- print(e);
- exit(1);
- } catch (e, s) {
- // Anything else is likely a compiler bug.
- //
- // --unsafe-force-compile is a bit of a grey area, but it's nice not to
- // crash while compiling
- // (of course, output code may crash, if it had errors).
- //
- print("");
- print("We're sorry, you've found a bug in our compiler.");
- print("You can report this bug at:");
- print(" https://github.com/dart-lang/dev_compiler/issues");
- print("");
- print("Please include the information below in your report, along with");
- print("any other information that may help us track it down. Thanks!");
- print("");
- print(" dartdevc arguments: " + args.join(' '));
- print(" dart --version: ${Platform.version}");
- print("");
- print("```");
- print(e);
- print(s);
- print("```");
+ } catch(e, s) {
+ exit(handleError(e, s, args));
+ }
+}
+
+/// If the final arg is `@file_path` then read in all the lines of that file
+/// and add those as args.
+///
+/// Bazel actions that support workers must provide all their per-WorkRequest
+/// arguments in a file like this instead of as normal args.
+List<String> _preprocessArgs(List<String> args) {
+ if (args.last.startsWith('@')) {
+ return new List.from(args)
+ ..addAll(new File(args.last.substring(1)).readAsLinesSync());
+ } else {
+ return args;
}
}
« no previous file with comments | « no previous file | lib/src/compiler/command.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698