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

Side by Side Diff: utils/compiler/create_snapshot.dart

Issue 15832003: Change File.directory to not do any IO (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/standalone/io/file_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « tests/standalone/io/file_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698