| 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 | 6 |
| 7 Future<String> getVersion(var rootPath) { | 7 Future<String> getVersion(var rootPath) { |
| 8 var suffix = Platform.operatingSystem == 'windows' ? '.exe' : ''; | 8 var suffix = Platform.operatingSystem == 'windows' ? '.exe' : ''; |
| 9 var printVersionScript = rootPath.resolve("tools/print_version.py"); | 9 var printVersionScript = rootPath.resolve("tools/print_version.py"); |
| 10 return Process.run("python$suffix", | 10 return Process.run("python$suffix", |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 if (!validArguments.contains(argumentSplit[0])) { | 76 if (!validArguments.contains(argumentSplit[0])) { |
| 77 throw "Invalid argument $argument"; | 77 throw "Invalid argument $argument"; |
| 78 } | 78 } |
| 79 args[argumentSplit[0].substring(2)] = argumentSplit[1]; | 79 args[argumentSplit[0].substring(2)] = argumentSplit[1]; |
| 80 } | 80 } |
| 81 if (!args.containsKey("dart2js_main")) throw "Please specify dart2js_main"; | 81 if (!args.containsKey("dart2js_main")) throw "Please specify dart2js_main"; |
| 82 if (!args.containsKey("dartdoc_main")) throw "Please specify dartdoc_main"; | 82 if (!args.containsKey("dartdoc_main")) throw "Please specify dartdoc_main"; |
| 83 if (!args.containsKey("output_dir")) throw "Please specify output_dir"; | 83 if (!args.containsKey("output_dir")) throw "Please specify output_dir"; |
| 84 if (!args.containsKey("package_root")) throw "Please specify package_root"; | 84 if (!args.containsKey("package_root")) throw "Please specify package_root"; |
| 85 | 85 |
| 86 var scriptFile = new Uri.file(new File(Platform.script).fullPathSync()); | 86 var scriptFile = |
| 87 new Uri.file(new File(Platform.script).resolveSymbolicLinksSync()); |
| 87 var path = scriptFile.resolve("."); | 88 var path = scriptFile.resolve("."); |
| 88 var rootPath = path.resolve("../.."); | 89 var rootPath = path.resolve("../.."); |
| 89 getSnapshotGenerationFile(args, rootPath).then((result) { | 90 getSnapshotGenerationFile(args, rootPath).then((result) { |
| 90 var wrapper = "${args['output_dir']}/utils_wrapper.dart"; | 91 var wrapper = "${args['output_dir']}/utils_wrapper.dart"; |
| 91 writeSnapshotFile(wrapper, result); | 92 writeSnapshotFile(wrapper, result); |
| 92 createSnapshot(wrapper, args["package_root"]); | 93 createSnapshot(wrapper, args["package_root"]); |
| 93 }); | 94 }); |
| 94 } | 95 } |
| OLD | NEW |