| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 import 'dart:io' show exit, exitCode; | |
| 6 | |
| 7 import '../compiler_command_line.dart' show CompilerCommandLine; | |
| 8 | |
| 9 import '../compiler_context.dart' show CompilerContext; | |
| 10 | |
| 11 import '../outline.dart' show CompileTask; | |
| 12 | |
| 13 import '../errors.dart' show InputError; | |
| 14 | |
| 15 import '../run.dart' show run; | |
| 16 | |
| 17 import '../ticker.dart' show Ticker; | |
| 18 | |
| 19 const int iterations = const int.fromEnvironment("iterations", defaultValue: 1); | |
| 20 | |
| 21 main(List<String> arguments) async { | |
| 22 Uri uri; | |
| 23 for (int i = 0; i < iterations; i++) { | |
| 24 await CompilerCommandLine.withGlobalOptions("run", arguments, | |
| 25 (CompilerContext c) async { | |
| 26 if (i > 0) { | |
| 27 print("\n"); | |
| 28 } | |
| 29 try { | |
| 30 CompileTask task = | |
| 31 new CompileTask(c, new Ticker(isVerbose: c.options.verbose)); | |
| 32 uri = await task.compile(); | |
| 33 } on InputError catch (e) { | |
| 34 print(e.format()); | |
| 35 exit(1); | |
| 36 } | |
| 37 if (exitCode != 0) exit(exitCode); | |
| 38 if (i + 1 == iterations) { | |
| 39 exit(await run(uri, c)); | |
| 40 } | |
| 41 }); | |
| 42 } | |
| 43 } | |
| OLD | NEW |