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

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

Issue 16673006: Fix for issue 11112 align flags to formats used by other tools. (Closed) Base URL: http://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 | « runtime/bin/main.cc ('k') | utils/pub/pub.gyp » ('j') | 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 void writeSnapshotFile(var path, var content) { 51 void writeSnapshotFile(var path, var content) {
52 File file = new File(path); 52 File file = new File(path);
53 var writer = file.openSync(mode: FileMode.WRITE); 53 var writer = file.openSync(mode: FileMode.WRITE);
54 writer.writeStringSync(content); 54 writer.writeStringSync(content);
55 writer.close(); 55 writer.close();
56 } 56 }
57 57
58 Future createSnapshot(var options, var dart_file, var packageRoot) { 58 Future createSnapshot(var options, var dart_file, var packageRoot) {
59 return Process.run(options.executable, 59 return Process.run(options.executable,
60 ["--package-root=$packageRoot", 60 ["--package-root=$packageRoot",
61 "--generate-script-snapshot=$dart_file.snapshot", 61 "--snapshot=$dart_file.snapshot",
62 dart_file]) 62 dart_file])
63 .then((result) { 63 .then((result) {
64 if (result.exitCode != 0) { 64 if (result.exitCode != 0) {
65 throw "Could not generate snapshot"; 65 throw "Could not generate snapshot";
66 } 66 }
67 }); 67 });
68 } 68 }
69 69
70 /** 70 /**
71 * Takes the following arguments: 71 * Takes the following arguments:
(...skipping 20 matching lines...) Expand all
92 92
93 var scriptFile = new File(new File(options.script).fullPathSync()); 93 var scriptFile = new File(new File(options.script).fullPathSync());
94 var path = new Path(scriptFile.directory.path); 94 var path = new Path(scriptFile.directory.path);
95 var rootPath = path.directoryPath.directoryPath; 95 var rootPath = path.directoryPath.directoryPath;
96 getSnapshotGenerationFile(options, args, rootPath).then((result) { 96 getSnapshotGenerationFile(options, args, rootPath).then((result) {
97 var wrapper = "${args['output_dir']}/utils_wrapper.dart"; 97 var wrapper = "${args['output_dir']}/utils_wrapper.dart";
98 writeSnapshotFile(wrapper, result); 98 writeSnapshotFile(wrapper, result);
99 createSnapshot(options, wrapper, args["package_root"]); 99 createSnapshot(options, wrapper, args["package_root"]);
100 }); 100 });
101 } 101 }
OLDNEW
« no previous file with comments | « runtime/bin/main.cc ('k') | utils/pub/pub.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698