Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(889)

Unified Diff: utils/compiler/create_snapshot.dart

Issue 13890016: Use checked-in binary to call tools/version.dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/compiler/create_snapshot.dart
diff --git a/utils/compiler/create_snapshot.dart b/utils/compiler/create_snapshot.dart
index f0e50082dbd03baad7fe4c588f7f7d05f065f853..f1bc9dbf30d1260aaea99a3141547e52cb5097c4 100644
--- a/utils/compiler/create_snapshot.dart
+++ b/utils/compiler/create_snapshot.dart
@@ -5,8 +5,12 @@
import 'dart:io';
Future<String> getVersion(var options, var rootPath) {
+ var os = Platform.operatingSystem;
+ var suffix = os == 'windows' ? '.exe' : '';
+ var checkedInBinary =
+ rootPath.join(new Path('tools/testing/bin/$os/dart$suffix'));
var versionPath = rootPath.append("tools").append("version.dart");
- return Process.run(options.executable,
+ return Process.run(checkedInBinary.toNativePath(),
[versionPath.toNativePath()])
.then((result) {
if (result.exitCode != 0) {
@@ -20,7 +24,7 @@ Future<String> getSnapshotGenerationFile(var options, var args, var rootPath) {
var dart2js = rootPath.append(args["dart2js_main"]);
return getVersion(options, rootPath).then((version) {
- var snapshotGenerationText =
+ var snapshotGenerationText =
"""
import '${dart2js}' as dart2jsMain;
import 'dart:io';
@@ -63,7 +67,7 @@ Future createSnapshot(var options, var dart_file) {
* --output_dir=val The full path to the output_dir.
* --dart2js_main=val The path to the dart2js main script releative to root.
*/
-void main() {
+void main() {
Options options = new Options();
var validArguments = ["--output_dir", "--dart2js_main"];
var args = {};
@@ -79,7 +83,7 @@ void main() {
if (!args.containsKey("output_dir")) throw "Please specify output_dir";
var scriptFile = new File(options.script);
- var path = new Path(scriptFile.directorySync().path);
+ var path = new Path(scriptFile.directorySync().path);
var rootPath = path.directoryPath.directoryPath;
getSnapshotGenerationFile(options, args, rootPath).then((result) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698