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 options, var rootPath) { | 7 Future<String> getVersion(var options, var rootPath) { |
8 var os = Platform.operatingSystem; | 8 var os = Platform.operatingSystem; |
9 var suffix = os == 'windows' ? '.exe' : ''; | 9 var suffix = os == 'windows' ? '.exe' : ''; |
10 var checkedInBinary = | 10 var checkedInBinary = |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 var argumentSplit = argument.split("="); | 75 var argumentSplit = argument.split("="); |
76 if (argumentSplit.length != 2) throw "Invalid argument $argument, no ="; | 76 if (argumentSplit.length != 2) throw "Invalid argument $argument, no ="; |
77 if (!validArguments.contains(argumentSplit[0])) { | 77 if (!validArguments.contains(argumentSplit[0])) { |
78 throw "Invalid argument $argument"; | 78 throw "Invalid argument $argument"; |
79 } | 79 } |
80 args[argumentSplit[0].substring(2)] = argumentSplit[1]; | 80 args[argumentSplit[0].substring(2)] = argumentSplit[1]; |
81 } | 81 } |
82 if (!args.containsKey("dart2js_main")) throw "Please specify dart2js_main"; | 82 if (!args.containsKey("dart2js_main")) throw "Please specify dart2js_main"; |
83 if (!args.containsKey("output_dir")) throw "Please specify output_dir"; | 83 if (!args.containsKey("output_dir")) throw "Please specify output_dir"; |
84 | 84 |
85 var scriptFile = new File(options.script); | 85 var scriptFile = new File(new File(options.script).fullPathSync()); |
86 var path = new Path(scriptFile.directorySync().path); | 86 var path = new Path(scriptFile.directory.path); |
87 var rootPath = path.directoryPath.directoryPath; | 87 var rootPath = path.directoryPath.directoryPath; |
88 | |
89 getSnapshotGenerationFile(options, args, rootPath).then((result) { | 88 getSnapshotGenerationFile(options, args, rootPath).then((result) { |
90 var wrapper = "${args['output_dir']}/utils_wrapper.dart"; | 89 var wrapper = "${args['output_dir']}/utils_wrapper.dart"; |
91 writeSnapshotFile(wrapper, result); | 90 writeSnapshotFile(wrapper, result); |
92 createSnapshot(options, wrapper); | 91 createSnapshot(options, wrapper); |
93 }); | 92 }); |
94 } | 93 } |
OLD | NEW |