OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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:io'; | 5 import 'dart:io'; |
6 import 'dart:async'; | |
7 | 6 |
8 Future<String> getVersion(var rootPath) { | 7 Future<String> getVersion(var rootPath) { |
9 var suffix = Platform.operatingSystem == 'windows' ? '.exe' : ''; | 8 var suffix = Platform.operatingSystem == 'windows' ? '.exe' : ''; |
10 var printVersionScript = rootPath.resolve("tools/print_version.py"); | 9 var printVersionScript = rootPath.resolve("tools/print_version.py"); |
11 return Process | 10 return Process |
12 .run("python$suffix", [printVersionScript.toFilePath()]).then((result) { | 11 .run("python$suffix", [printVersionScript.toFilePath()]).then((result) { |
13 if (result.exitCode != 0) { | 12 if (result.exitCode != 0) { |
14 throw "Could not generate version"; | 13 throw "Could not generate version"; |
15 } | 14 } |
16 return result.stdout.trim(); | 15 return result.stdout.trim(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 getSnapshotGenerationFile(args, rootPath).then((result) { | 84 getSnapshotGenerationFile(args, rootPath).then((result) { |
86 var wrapper = "${args['output_dir']}/utils_wrapper.dart"; | 85 var wrapper = "${args['output_dir']}/utils_wrapper.dart"; |
87 writeSnapshotFile(wrapper, result); | 86 writeSnapshotFile(wrapper, result); |
88 }); | 87 }); |
89 | 88 |
90 getDart2jsSnapshotGenerationFile(args, rootPath).then((result) { | 89 getDart2jsSnapshotGenerationFile(args, rootPath).then((result) { |
91 var wrapper = "${args['output_dir']}/dart2js.dart"; | 90 var wrapper = "${args['output_dir']}/dart2js.dart"; |
92 writeSnapshotFile(wrapper, result); | 91 writeSnapshotFile(wrapper, result); |
93 }); | 92 }); |
94 } | 93 } |
OLD | NEW |