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.outline; | 5 library fasta.outline; |
6 | 6 |
7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import 'dart:io' show exitCode; | 9 import 'dart:io' show exitCode; |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 final Ticker ticker; | 85 final Ticker ticker; |
86 | 86 |
87 CompileTask(this.c, this.ticker); | 87 CompileTask(this.c, this.ticker); |
88 | 88 |
89 KernelTarget createKernelTarget( | 89 KernelTarget createKernelTarget( |
90 DillTarget dillTarget, TranslateUri uriTranslator) { | 90 DillTarget dillTarget, TranslateUri uriTranslator) { |
91 return new KernelTarget(dillTarget, uriTranslator, c.uriToSource); | 91 return new KernelTarget(dillTarget, uriTranslator, c.uriToSource); |
92 } | 92 } |
93 | 93 |
94 Future<KernelTarget> buildOutline([Uri output]) async { | 94 Future<KernelTarget> buildOutline([Uri output]) async { |
95 TranslateUri uriTranslator = await TranslateUri.parse(c.options.sdk); | 95 TranslateUri uriTranslator = |
| 96 await TranslateUri.parse(c.options.sdk, c.options.packages); |
96 ticker.logMs("Read packages file"); | 97 ticker.logMs("Read packages file"); |
97 DillTarget dillTarget = new DillTarget(ticker, uriTranslator); | 98 DillTarget dillTarget = new DillTarget(ticker, uriTranslator); |
98 KernelTarget kernelTarget = createKernelTarget(dillTarget, uriTranslator); | 99 KernelTarget kernelTarget = createKernelTarget(dillTarget, uriTranslator); |
99 Uri platform = c.options.platform; | 100 Uri platform = c.options.platform; |
100 if (platform != null) { | 101 if (platform != null) { |
101 dillTarget.read(platform); | 102 dillTarget.read(platform); |
102 } | 103 } |
103 String argument = c.options.arguments.first; | 104 String argument = c.options.arguments.first; |
104 Uri uri = Uri.base.resolve(argument); | 105 Uri uri = Uri.base.resolve(argument); |
105 String path = uriTranslator.translate(uri)?.path ?? argument; | 106 String path = uriTranslator.translate(uri)?.path ?? argument; |
(...skipping 26 matching lines...) Expand all Loading... |
132 exitCode = 1; | 133 exitCode = 1; |
133 print("Verification of program failed: $e"); | 134 print("Verification of program failed: $e"); |
134 if (s != null && c.options.verbose) { | 135 if (s != null && c.options.verbose) { |
135 print(s); | 136 print(s); |
136 } | 137 } |
137 } | 138 } |
138 } | 139 } |
139 return uri; | 140 return uri; |
140 } | 141 } |
141 } | 142 } |
OLD | NEW |