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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library fasta; | 5 library fasta; |
6 | 6 |
7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import 'dart:convert' show JSON; | 9 import 'dart:convert' show JSON; |
10 | 10 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 var sink = new ByteSink(); | 215 var sink = new ByteSink(); |
216 bool predicate(Library library) => !library.importUri.isScheme('dart'); | 216 bool predicate(Library library) => !library.importUri.isScheme('dart'); |
217 new LibraryFilteringBinaryPrinter(sink, predicate) | 217 new LibraryFilteringBinaryPrinter(sink, predicate) |
218 .writeProgramFile(program); | 218 .writeProgramFile(program); |
219 return new CompilationResult.ok(sink.builder.takeBytes()); | 219 return new CompilationResult.ok(sink.builder.takeBytes()); |
220 } catch (e, s) { | 220 } catch (e, s) { |
221 return reportCrash(e, s, fileName); | 221 return reportCrash(e, s, fileName); |
222 } | 222 } |
223 } | 223 } |
224 | 224 |
225 Future compilePlatform(Uri patchedSdk, Uri output, | 225 Future compilePlatform(Uri patchedSdk, Uri fullOutput, |
226 {Uri packages, bool verbose: false}) async { | 226 {Uri outlineOutput, Uri packages, bool verbose: false}) async { |
227 Ticker ticker = new Ticker(isVerbose: verbose); | 227 Ticker ticker = new Ticker(isVerbose: verbose); |
228 await CompilerCommandLine.withGlobalOptions("", [""], (CompilerContext c) { | 228 await CompilerCommandLine.withGlobalOptions("", [""], (CompilerContext c) { |
229 c.options.options["--packages"] = packages; | 229 c.options.options["--packages"] = packages; |
230 if (verbose) { | 230 if (verbose) { |
231 c.options.options["--verbose"] = true; | 231 c.options.options["--verbose"] = true; |
232 } | 232 } |
233 return compilePlatformInternal(c, ticker, patchedSdk, output); | 233 return compilePlatformInternal( |
| 234 c, ticker, patchedSdk, fullOutput, outlineOutput); |
234 }); | 235 }); |
235 } | 236 } |
236 | 237 |
237 Future writeDepsFile(Uri script, Uri depsFile, Uri output, | 238 Future writeDepsFile(Uri script, Uri depsFile, Uri output, |
238 {Uri packages, | 239 {Uri packages, |
239 Uri platform, | 240 Uri platform, |
240 Iterable<Uri> extraDependencies, | 241 Iterable<Uri> extraDependencies, |
241 bool verbose: false}) async { | 242 bool verbose: false}) async { |
242 Ticker ticker = new Ticker(isVerbose: verbose); | 243 Ticker ticker = new Ticker(isVerbose: verbose); |
243 await CompilerCommandLine.withGlobalOptions("", [""], | 244 await CompilerCommandLine.withGlobalOptions("", [""], |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 final BytesBuilder builder = new BytesBuilder(); | 277 final BytesBuilder builder = new BytesBuilder(); |
277 | 278 |
278 void add(List<int> data) { | 279 void add(List<int> data) { |
279 builder.add(data); | 280 builder.add(data); |
280 } | 281 } |
281 | 282 |
282 void close() { | 283 void close() { |
283 // Nothing to do. | 284 // Nothing to do. |
284 } | 285 } |
285 } | 286 } |
OLD | NEW |