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

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: Revise. 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
« no previous file with comments | « sdk/lib/_internal/pub/bin/async_compile.dart ('k') | sdk/lib/_internal/pub/test/test_pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7f8c9ec088523d54586b963e7da172130c15ab0b..f3b0f1c4ccfe5bc47a0f2b44960eb4ae3ba04811 100644
--- a/sdk/lib/_internal/pub/lib/src/io.dart
+++ b/sdk/lib/_internal/pub/lib/src/io.dart
@@ -486,8 +486,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.
« no previous file with comments | « sdk/lib/_internal/pub/bin/async_compile.dart ('k') | sdk/lib/_internal/pub/test/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698