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

Side by Side Diff: utils/pub/sdk_source.dart

Issue 10399076: Get codebase ready for actually supporting versioning. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to review. Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/pub/pubspec.dart ('k') | utils/pub/source.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * A package source that uses libraries from the Dart SDK. 6 * A package source that uses libraries from the Dart SDK.
7 * 7 *
8 * This currently uses the "sdkdir" command-line argument to find the SDK. 8 * This currently uses the "sdkdir" command-line argument to find the SDK.
9 */ 9 */
10 // TODO(nweiz): This should read the SDK directory from an environment variable 10 // TODO(nweiz): This should read the SDK directory from an environment variable
11 // once we can set those for tests. 11 // once we can set those for tests.
12 class SdkSource extends Source { 12 class SdkSource extends Source {
13 final String name = "sdk"; 13 final String name = "sdk";
14 final bool shouldCache = false; 14 final bool shouldCache = false;
15 15
16 /** 16 /**
17 * The root directory of the Dart SDK. 17 * The root directory of the Dart SDK.
18 */ 18 */
19 final String rootDir; 19 final String rootDir;
20 20
21 SdkSource(this.rootDir); 21 SdkSource(this.rootDir);
22 22
23 /** 23 /**
24 * Since all the SDK files are already available locally, installation just 24 * Since all the SDK files are already available locally, installation just
25 * involves symlinking the SDK library into the packages directory. 25 * involves symlinking the SDK library into the packages directory.
26 */ 26 */
27 Future<bool> install(PackageId id, String destPath) { 27 Future<bool> install(PackageId id, String destPath) {
28 var sourcePath = join(rootDir, "lib", id.fullName); 28 var sourcePath = join(rootDir, "lib", id.description);
29 return exists(sourcePath).chain((exists) { 29 return exists(sourcePath).chain((exists) {
30 if (!exists) return new Future<bool>.immediate(false); 30 if (!exists) return new Future<bool>.immediate(false);
31 return createSymlink(sourcePath, destPath).transform((_) => true); 31 return createSymlink(sourcePath, destPath).transform((_) => true);
32 }); 32 });
33 } 33 }
34 } 34 }
OLDNEW
« no previous file with comments | « utils/pub/pubspec.dart ('k') | utils/pub/source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698