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

Unified Diff: utils/compiler/create_snapshot.dart

Issue 23054008: Remove the Path class from dart:io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed first round of review comments Created 7 years, 4 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 | « tools/coverage.dart ('k') | 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 5e429bd29dd56e0b8d08feca8108ed0cc3074ff1..2f2bd175dcc7064091270f825f4cdf30ddb7d26c 100644
--- a/utils/compiler/create_snapshot.dart
+++ b/utils/compiler/create_snapshot.dart
@@ -6,9 +6,9 @@ import 'dart:io';
Future<String> getVersion(var options, var rootPath) {
var suffix = Platform.operatingSystem == 'windows' ? '.exe' : '';
- var printVersionScript =
- rootPath.append("tools").append("print_version.py").toNativePath();
- return Process.run("python$suffix", [printVersionScript]).then((result) {
+ var printVersionScript = rootPath.resolve("tools/print_version.py");
+ return Process.run("python$suffix",
+ [printVersionScript.toFilePath()]).then((result) {
if (result.exitCode != 0) {
throw "Could not generate version";
}
@@ -17,14 +17,13 @@ Future<String> getVersion(var options, var rootPath) {
}
Future<String> getSnapshotGenerationFile(var options, var args, var rootPath) {
- var dart2js = rootPath.append(args["dart2js_main"]);
- var dartdoc = rootPath.append(args["dartdoc_main"]);
-
+ var dart2js = rootPath.resolve(args["dart2js_main"]);
+ var dartdoc = rootPath.resolve(args["dartdoc_main"]);
return getVersion(options, rootPath).then((version) {
var snapshotGenerationText =
"""
-import '${dart2js}' as dart2jsMain;
-import '${dartdoc}' as dartdocMain;
+import '${dart2js.toFilePath()}' as dart2jsMain;
ahe 2013/08/15 09:29:00 That isn't right. Dart imports use URI syntax.
+import '${dartdoc.toFilePath()}' as dartdocMain;
import 'dart:io';
void main() {
@@ -86,9 +85,9 @@ void main() {
if (!args.containsKey("output_dir")) throw "Please specify output_dir";
if (!args.containsKey("package_root")) throw "Please specify package_root";
- var scriptFile = new File(new File(options.script).fullPathSync());
- var path = new Path(scriptFile.directory.path);
- var rootPath = path.directoryPath.directoryPath;
+ var scriptFile = new Uri.file(new File(options.script).fullPathSync());
+ var path = scriptFile.resolve(".");
+ var rootPath = path.resolve("../..");
getSnapshotGenerationFile(options, args, rootPath).then((result) {
var wrapper = "${args['output_dir']}/utils_wrapper.dart";
writeSnapshotFile(wrapper, result);
« no previous file with comments | « tools/coverage.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698