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

Unified Diff: lib/src/rastak.dart

Issue 2027593003: Resolve target specification relative to script. (Closed) Base URL: git@github.com:dart-lang/rasta.git@master
Patch Set: Use Isolate.resolvePackageUri. Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/rastak.dart
diff --git a/lib/src/rastak.dart b/lib/src/rastak.dart
index a959a99ecd26353be1c723f6fb94c7e4139c551e..30841a464ba0d293602b360664b254e6c6ff58b0 100644
--- a/lib/src/rastak.dart
+++ b/lib/src/rastak.dart
@@ -11,6 +11,9 @@ import 'dart:io' show
File,
IOSink;
+import 'dart:isolate' show
+ Isolate;
+
import 'package:compiler/src/common/tasks.dart' show
CompilerTask;
@@ -128,9 +131,12 @@ Future<Null> main(List<String> arguments, isolateArgument) async {
Options options = new OptionParser().parse(arguments, Uri.base);
List<String> compilerOptions =
options.isVerbose ? <String>['--verbose'] : <String>[];
+ Uri script = await Isolate.resolvePackageUri(
+ Uri.parse("package:rasta/src/rastak.dart"));
+ Uri targetSpecification = Uri.base.resolveUri(script)
+ .resolve("../../dart_vm_standalone.json");
IoCompilerFactory factory = new IoCompilerFactory(
- Uri.base.resolve("dart_vm_standalone.json"), compilerOptions,
- <String, dynamic>{});
+ targetSpecification, compilerOptions, <String, dynamic>{});
(await factory.diagnostics)
..verbose = options.isVerbose
..showWarnings = true
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698