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

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

Issue 2368073004: Add --packages flag when compiling dart2js snapshot (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | 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 rootPath) { 7 Future<String> getVersion(var rootPath) {
8 var suffix = Platform.operatingSystem == 'windows' ? '.exe' : ''; 8 var suffix = Platform.operatingSystem == 'windows' ? '.exe' : '';
9 var printVersionScript = rootPath.resolve("tools/print_version.py"); 9 var printVersionScript = rootPath.resolve("tools/print_version.py");
10 return Process.run("python$suffix", 10 return Process.run("python$suffix",
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 void writeSnapshotFile(var path, var content) { 57 void writeSnapshotFile(var path, var content) {
58 File file = new File(path); 58 File file = new File(path);
59 var writer = file.openSync(mode: FileMode.WRITE); 59 var writer = file.openSync(mode: FileMode.WRITE);
60 writer.writeStringSync(content); 60 writer.writeStringSync(content);
61 writer.close(); 61 writer.close();
62 } 62 }
63 63
64 Future createSnapshot(var dart_file) { 64 Future createSnapshot(var dart_file) {
65 return Process.run(Platform.executable, 65 return Process.run(Platform.executable,
66 ["--snapshot=$dart_file.snapshot", 66 ["--packages=../../.packages",
67 "--snapshot=$dart_file.snapshot",
67 dart_file]) 68 dart_file])
68 .then((result) { 69 .then((result) {
69 if (result.exitCode != 0) { 70 if (result.exitCode != 0) {
70 print("Could not generate snapshot: result code ${result.exitCode}"); 71 print("Could not generate snapshot: result code ${result.exitCode}");
71 print(result.stdout); 72 print(result.stdout);
72 print(result.stderr); 73 print(result.stderr);
73 throw "Could not generate snapshot"; 74 throw "Could not generate snapshot";
74 } 75 }
75 }); 76 });
76 } 77 }
(...skipping 26 matching lines...) Expand all
103 createSnapshot(wrapper); 104 createSnapshot(wrapper);
104 }); 105 });
105 106
106 getDart2jsSnapshotGenerationFile(args, rootPath).then((result) { 107 getDart2jsSnapshotGenerationFile(args, rootPath).then((result) {
107 var wrapper = "${args['output_dir']}/dart2js.dart"; 108 var wrapper = "${args['output_dir']}/dart2js.dart";
108 writeSnapshotFile(wrapper, result); 109 writeSnapshotFile(wrapper, result);
109 createSnapshot(wrapper); 110 createSnapshot(wrapper);
110 }); 111 });
111 112
112 } 113 }
OLDNEW
« 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