OLD | NEW |
---|---|
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library rasta.rastak; | 5 library rasta.rastak; |
6 | 6 |
7 import 'dart:async' show | 7 import 'dart:async' show |
8 Future; | 8 Future; |
9 | 9 |
10 import 'dart:io' show | 10 import 'dart:io' show |
11 Platform, | |
kasperl
2016/05/31 17:47:04
Sort alphabetically?
ahe
2016/05/31 22:28:22
Done.
| |
11 File, | 12 File, |
12 IOSink; | 13 IOSink; |
13 | 14 |
14 import 'package:compiler/src/common/tasks.dart' show | 15 import 'package:compiler/src/common/tasks.dart' show |
15 CompilerTask; | 16 CompilerTask; |
16 | 17 |
17 import 'package:compiler/src/elements/elements.dart' show | 18 import 'package:compiler/src/elements/elements.dart' show |
18 CompilationUnitElement, | 19 CompilationUnitElement, |
19 LibraryElement; | 20 LibraryElement; |
20 | 21 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 await sink.close(); | 122 await sink.close(); |
122 } | 123 } |
123 print("Wrote $uri"); | 124 print("Wrote $uri"); |
124 } | 125 } |
125 | 126 |
126 Future<Null> main(List<String> arguments, isolateArgument) async { | 127 Future<Null> main(List<String> arguments, isolateArgument) async { |
127 Stopwatch wallClock = new Stopwatch()..start(); | 128 Stopwatch wallClock = new Stopwatch()..start(); |
128 Options options = new OptionParser().parse(arguments, Uri.base); | 129 Options options = new OptionParser().parse(arguments, Uri.base); |
129 List<String> compilerOptions = | 130 List<String> compilerOptions = |
130 options.isVerbose ? <String>['--verbose'] : <String>[]; | 131 options.isVerbose ? <String>['--verbose'] : <String>[]; |
132 Uri targetSpecification = Uri.base.resolveUri(Platform.script) | |
133 .resolve("../dart_vm_standalone.json"); | |
131 IoCompilerFactory factory = new IoCompilerFactory( | 134 IoCompilerFactory factory = new IoCompilerFactory( |
132 Uri.base.resolve("dart_vm_standalone.json"), compilerOptions, | 135 targetSpecification, compilerOptions, <String, dynamic>{}); |
133 <String, dynamic>{}); | |
134 (await factory.diagnostics) | 136 (await factory.diagnostics) |
135 ..verbose = options.isVerbose | 137 ..verbose = options.isVerbose |
136 ..showWarnings = true | 138 ..showWarnings = true |
137 ..throwOnError = true | 139 ..throwOnError = true |
138 ..throwOnErrorCount = 1; | 140 ..throwOnErrorCount = 1; |
139 | 141 |
140 CustomCompiler compiler = await factory.compiler; | 142 CustomCompiler compiler = await factory.compiler; |
141 Rastask task = new Rastask(compiler); | 143 Rastask task = new Rastask(compiler); |
142 compiler.tasks.add(task); | 144 compiler.tasks.add(task); |
143 | 145 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 await openWrite(options.dependenciesFile, (IOSink sink) { | 201 await openWrite(options.dependenciesFile, (IOSink sink) { |
200 void writeCompilationUnit(CompilationUnitElement unit) { | 202 void writeCompilationUnit(CompilationUnitElement unit) { |
201 sink.write("${unit.script.resourceUri}\n"); | 203 sink.write("${unit.script.resourceUri}\n"); |
202 } | 204 } |
203 kernel.forEachLibraryElement((LibraryElement library) { | 205 kernel.forEachLibraryElement((LibraryElement library) { |
204 library.compilationUnits.forEach(writeCompilationUnit); | 206 library.compilationUnits.forEach(writeCompilationUnit); |
205 }); | 207 }); |
206 }); | 208 }); |
207 } | 209 } |
208 } | 210 } |
OLD | NEW |