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

Unified Diff: sdk/lib/_internal/pub/lib/src/io.dart

Issue 472173004: Skeleton code for running the forthcoming async/await compiler on pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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: sdk/lib/_internal/pub/lib/src/io.dart
diff --git a/sdk/lib/_internal/pub/lib/src/io.dart b/sdk/lib/_internal/pub/lib/src/io.dart
index ffbf30e71dcf45da820faa72b097839f38d69773..8a6d66fa2c522785391479a8aa7f631c335860ba 100644
--- a/sdk/lib/_internal/pub/lib/src/io.dart
+++ b/sdk/lib/_internal/pub/lib/src/io.dart
@@ -476,8 +476,24 @@ String get repoRoot {
if (runningFromSdk) {
throw new StateError("Can't get the repo root from the SDK.");
}
- return path.normalize(path.join(
- path.dirname(libraryPath('pub.io')), '..', '..', '..', '..', '..', '..'));
+
+ // Get the path to the directory containing this very file.
+ var libDir = path.dirname(libraryPath('pub.io'));
+
+ // TODO(rnystrom): Remove this when #104 is fixed.
+ // If we are running from the async/await compiled build directory, walk out
+ // out of that. It will be something like:
+ //
+ // <repo>/<build>/<config>/pub_async/lib/src
+ if (libDir.contains('pub_async')) {
+ return path.normalize(path.join(libDir, '..', '..', '..', '..', '..'));
+ }
+
+ // Otherwise, assume we're running directly from the source location in the
+ // repo:
+ //
+ // <repo>/sdk/lib/_internal/pub/lib/src
+ return path.normalize(path.join(libDir, '..', '..', '..', '..', '..', '..'));
}
/// A line-by-line stream of standard input.

Powered by Google App Engine
This is Rietveld 408576698