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

Unified Diff: pkg/front_end/lib/src/fasta/outline.dart

Issue 2676823002: Add option --compile-sdk to fasta compile and run. (Closed)
Patch Set: Address comments. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/outline.dart
diff --git a/pkg/front_end/lib/src/fasta/outline.dart b/pkg/front_end/lib/src/fasta/outline.dart
index e179cd9829a2936d605ae7135bf464869f7a6ef4..6983a4a2eefd193004cf8aaec92cca979c3f849c 100644
--- a/pkg/front_end/lib/src/fasta/outline.dart
+++ b/pkg/front_end/lib/src/fasta/outline.dart
@@ -35,6 +35,11 @@ import 'translate_uri.dart' show
import 'ast_kind.dart' show
AstKind;
+// TODO(ahe): Remove this import. Instead make the SDK available as resource in
+// the executable, or something similar.
+import 'testing/kernel_chain.dart' show
+ computePatchedSdk;
+
CompilerCommandLine parseArguments(String programName, List<String> arguments) {
return new CompilerCommandLine(programName, arguments);
}
@@ -81,12 +86,17 @@ Future<Uri> kompile(List<String> arguments) async {
Future<KernelSourceTarget> doOutline(CompilerCommandLine cl, Ticker ticker,
[Uri output]) async {
- TranslateUri uriTranslator = await TranslateUri.parse();
+ Uri sdk = await computePatchedSdk();
+ ticker.logMs("Found patched SDK");
+ TranslateUri uriTranslator = await TranslateUri.parse(sdk);
ticker.logMs("Read packages file");
DillTarget dillTarget = new DillTarget(ticker, uriTranslator);
KernelSourceTarget sourceTarget =
new KernelSourceTarget(dillTarget, uriTranslator);
- dillTarget.read(cl.platform);
+ Uri platform = cl.platform;
+ if (platform != null) {
+ dillTarget.read(platform);
+ }
String argument = cl.arguments.first;
Uri uri = Uri.base.resolve(argument);
String path = uriTranslator.translate(uri)?.path ?? argument;
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_target.dart ('k') | pkg/front_end/lib/src/fasta/source/diet_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698