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

Unified Diff: runtime/bin/builtin.dart

Issue 10134015: added package_root flag to standalone dart vm (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix blank lines Created 8 years, 8 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 | runtime/bin/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/builtin.dart
diff --git a/runtime/bin/builtin.dart b/runtime/bin/builtin.dart
index e0108096f6c8934346edbf6b103b0ea3dfe26d75..c2b98e272eb3341b6a4c999e988f3a44f83cf25d 100644
--- a/runtime/bin/builtin.dart
+++ b/runtime/bin/builtin.dart
@@ -32,6 +32,9 @@ var _is_windows;
// package imports can be resolved relative to it.
Uri _entrypoint;
+// The directory to look in to resolve "package:" scheme URIs.
+String _packageRoot;
+
void _logResolution(String msg) {
final enabled = false;
if (enabled) {
@@ -39,6 +42,12 @@ void _logResolution(String msg) {
}
}
+String _setPackageRoot(String packageRoot) {
+ // TODO(mattsh) - refactor windows drive and path handling code
+ // so it can be used here if needed.
+ _packageRoot = packageRoot;
+}
+
String _resolveScriptUri(String cwd, String scriptName, bool windows) {
_is_windows = windows;
_logResolution("# Current working directory: $cwd");
@@ -141,7 +150,13 @@ String _filePathFromPackageUri(Uri uri) {
"'$right', not '$wrong'.";
}
- var path = _entrypoint.resolve('packages/${uri.path}').path;
+ var path;
+ if (_packageRoot !== null) {
+ path = "${_packageRoot}${uri.path}";
+ } else {
+ path = _entrypoint.resolve('packages/${uri.path}').path;
+ }
+
_logResolution("# Package: $path");
return path;
}
« no previous file with comments | « no previous file | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698