OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library test.util.compiler_pool; | 5 library test.util.compiler_pool; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 IframeListener.start(() => test.main); | 66 IframeListener.start(() => test.main); |
67 } | 67 } |
68 '''); | 68 '''); |
69 | 69 |
70 var dart2jsPath = p.join(sdkDir, 'bin', 'dart2js'); | 70 var dart2jsPath = p.join(sdkDir, 'bin', 'dart2js'); |
71 if (Platform.isWindows) dart2jsPath += '.bat'; | 71 if (Platform.isWindows) dart2jsPath += '.bat'; |
72 | 72 |
73 var args = ["--checked", wrapperPath, "--out=$jsPath"]; | 73 var args = ["--checked", wrapperPath, "--out=$jsPath"]; |
74 | 74 |
75 if (packageRoot != null) { | 75 if (packageRoot != null) { |
76 args.add("--package-root=${p.absolute(packageRoot)}"); | 76 args.add("--package-root=${p.toUri(p.absolute(packageRoot))}"); |
77 } | 77 } |
78 | 78 |
79 if (_color) args.add("--enable-diagnostic-colors"); | 79 if (_color) args.add("--enable-diagnostic-colors"); |
80 | 80 |
81 return Process.start(dart2jsPath, args).then((process) { | 81 return Process.start(dart2jsPath, args).then((process) { |
82 var compiler = new _Compiler(dartPath, process); | 82 var compiler = new _Compiler(dartPath, process); |
83 | 83 |
84 if (_compilers.isEmpty) _showProcess(compiler); | 84 if (_compilers.isEmpty) _showProcess(compiler); |
85 _compilers.add(compiler); | 85 _compilers.add(compiler); |
86 | 86 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 /// The underlying process. | 129 /// The underlying process. |
130 final Process process; | 130 final Process process; |
131 | 131 |
132 /// A future that will complete once this instance has finished running and | 132 /// A future that will complete once this instance has finished running and |
133 /// all its output has been printed. | 133 /// all its output has been printed. |
134 Future get onDone => onDoneCompleter.future; | 134 Future get onDone => onDoneCompleter.future; |
135 final onDoneCompleter = new Completer(); | 135 final onDoneCompleter = new Completer(); |
136 | 136 |
137 _Compiler(this.path, this.process); | 137 _Compiler(this.path, this.process); |
138 } | 138 } |
OLD | NEW |