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); |