| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async' show Future; | 5 import 'dart:async' show Future; |
| 6 | 6 |
| 7 import 'dart:io' show Directory, Platform; | 7 import 'dart:io' show Directory, Platform; |
| 8 | 8 |
| 9 import 'dart:isolate' show Isolate; | 9 import 'dart:isolate' show Isolate; |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 Future runCompiler(Uri compiler, Uri input, Uri output) async { | 39 Future runCompiler(Uri compiler, Uri input, Uri output) async { |
| 40 Uri patchedSdk = await computePatchedSdk(); | 40 Uri patchedSdk = await computePatchedSdk(); |
| 41 Uri dartVm = Uri.base.resolve(Platform.resolvedExecutable); | 41 Uri dartVm = Uri.base.resolve(Platform.resolvedExecutable); |
| 42 StdioProcess result = await StdioProcess.run(dartVm.toFilePath(), <String>[ | 42 StdioProcess result = await StdioProcess.run(dartVm.toFilePath(), <String>[ |
| 43 compiler.toFilePath(), | 43 compiler.toFilePath(), |
| 44 "--compile-sdk=${patchedSdk.toFilePath()}", | 44 "--compile-sdk=${patchedSdk.toFilePath()}", |
| 45 "--output=${output.toFilePath()}", | 45 "--output=${output.toFilePath()}", |
| 46 input.toFilePath(), | 46 input.toFilePath(), |
| 47 ]); | 47 ]); |
| 48 print(result.output); | 48 print(result.output); |
| 49 if (result.exitCode != 1) { | 49 if (result.exitCode != 0) { |
| 50 // TODO(ahe): Due to known errors in the VM's patch files, this compiler | |
| 51 // should report an error. Also, it may not be able to compile everything | |
| 52 // yet. | |
| 53 throw "Compilation failed."; | 50 throw "Compilation failed."; |
| 54 } | 51 } |
| 55 } | 52 } |
| OLD | NEW |