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

Unified Diff: utils/pub/sdk_source.dart

Issue 10857059: Look for SDK packages in "pkg" in addition to "lib". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « no previous file | utils/tests/pub/pub_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/sdk_source.dart
diff --git a/utils/pub/sdk_source.dart b/utils/pub/sdk_source.dart
index e6d46473ba703798ea83447cec7b1db52f54cf25..5b10d09e068e8f29ba60224c2de55241bda30afc 100644
--- a/utils/pub/sdk_source.dart
+++ b/utils/pub/sdk_source.dart
@@ -48,9 +48,19 @@ class SdkSource extends Source {
* involves symlinking the SDK library into the packages directory.
*/
Future<bool> install(PackageId id, String destPath) {
- var sourcePath = join(rootDir, "lib", id.description);
- return exists(sourcePath).chain((exists) {
- if (!exists) return new Future<bool>.immediate(false);
+ // Look in "pkg" first.
+ var sourcePath = join(rootDir, "pkg", id.description);
+ return exists(sourcePath).chain((found) {
+ if (!found) {
+ // TODO(rnystrom): Get rid of this when all SDK packages are moved from
+ // "lib" to "pkg".
+ // Not in "pkg", so try "lib".
+ sourcePath = join(rootDir, "lib", id.description);
+ return exists(sourcePath).chain((found) {
+ if (!found) return new Future<bool>.immediate(false);
+ return createSymlink(sourcePath, destPath).transform((_) => true);
+ });
+ }
return createSymlink(sourcePath, destPath).transform((_) => true);
});
}
« no previous file with comments | « no previous file | utils/tests/pub/pub_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698