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

Unified Diff: utils/compiler/create_snapshot.dart

Issue 66643006: Fix version generation for dart2js (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 | « utils/compiler/compiler.gyp ('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
===================================================================
--- utils/compiler/create_snapshot.dart (revision 30136)
+++ utils/compiler/create_snapshot.dart (working copy)
@@ -42,6 +42,23 @@
});
}
+Future<String> getDart2jsSnapshotGenerationFile(var args, var rootPath) {
+ var dart2js = rootPath.resolve(args["dart2js_main"]);
+ return getVersion(rootPath).then((version) {
+ var snapshotGenerationText =
+"""
+import '${dart2js.toFilePath(windows: false)}' as dart2jsMain;
+import 'dart:io';
+
+void main(List<String> arguments) {
+ dart2jsMain.BUILD_ID = "$version";
+ dart2jsMain.main(arguments.skip(1).toList());
+}
+""";
+ return snapshotGenerationText;
+ });
+}
+
void writeSnapshotFile(var path, var content) {
File file = new File(path);
var writer = file.openSync(mode: FileMode.WRITE);
@@ -91,4 +108,11 @@
writeSnapshotFile(wrapper, result);
createSnapshot(wrapper, args["package_root"]);
});
+
+ getDart2jsSnapshotGenerationFile(args, rootPath).then((result) {
+ var wrapper = "${args['output_dir']}/dart2js.dart";
+ writeSnapshotFile(wrapper, result);
+ createSnapshot(wrapper, args["package_root"]);
+ });
+
}
« no previous file with comments | « utils/compiler/compiler.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698