| OLD | NEW | 
|   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 #library('sdk_source'); | 
 |   6  | 
 |   7 #import('io.dart'); | 
 |   8 #import('package.dart'); | 
 |   9 #import('source.dart'); | 
 |  10  | 
|   5 /** |  11 /** | 
|   6  * A package source that uses libraries from the Dart SDK. |  12  * A package source that uses libraries from the Dart SDK. | 
|   7  * |  13  * | 
|   8  * This currently uses the "sdkdir" command-line argument to find the SDK. |  14  * This currently uses the "sdkdir" command-line argument to find the SDK. | 
|   9  */ |  15  */ | 
|  10 // TODO(nweiz): This should read the SDK directory from an environment variable |  16 // TODO(nweiz): This should read the SDK directory from an environment variable | 
|  11 // once we can set those for tests. |  17 // once we can set those for tests. | 
|  12 class SdkSource extends Source { |  18 class SdkSource extends Source { | 
|  13   final String name = "sdk"; |  19   final String name = "sdk"; | 
|  14   final bool shouldCache = false; |  20   final bool shouldCache = false; | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
|  25    * involves symlinking the SDK library into the packages directory. |  31    * involves symlinking the SDK library into the packages directory. | 
|  26    */ |  32    */ | 
|  27   Future<bool> install(PackageId id, String destPath) { |  33   Future<bool> install(PackageId id, String destPath) { | 
|  28     var sourcePath = join(rootDir, "lib", id.description); |  34     var sourcePath = join(rootDir, "lib", id.description); | 
|  29     return exists(sourcePath).chain((exists) { |  35     return exists(sourcePath).chain((exists) { | 
|  30       if (!exists) return new Future<bool>.immediate(false); |  36       if (!exists) return new Future<bool>.immediate(false); | 
|  31       return createSymlink(sourcePath, destPath).transform((_) => true); |  37       return createSymlink(sourcePath, destPath).transform((_) => true); | 
|  32     }); |  38     }); | 
|  33   } |  39   } | 
|  34 } |  40 } | 
| OLD | NEW |