| 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('package'); |
| 6 |
| 7 #import('io.dart'); |
| 8 #import('pubspec.dart'); |
| 9 #import('source.dart'); |
| 10 #import('source_registry.dart'); |
| 11 #import('version.dart'); |
| 12 |
| 5 /** | 13 /** |
| 6 * A named, versioned, unit of code and resource reuse. | 14 * A named, versioned, unit of code and resource reuse. |
| 7 */ | 15 */ |
| 8 class Package { | 16 class Package { |
| 9 /** | 17 /** |
| 10 * Loads the package whose root directory is [packageDir]. | 18 * Loads the package whose root directory is [packageDir]. |
| 11 */ | 19 */ |
| 12 static Future<Package> load(String packageDir, SourceRegistry sources) { | 20 static Future<Package> load(String packageDir, SourceRegistry sources) { |
| 13 var pubspecPath = join(packageDir, 'pubspec'); | 21 var pubspecPath = join(packageDir, 'pubspec'); |
| 14 | 22 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 /** | 164 /** |
| 157 * The metadata used to identify the package being referenced. The | 165 * The metadata used to identify the package being referenced. The |
| 158 * interpretation of this will vary based on the [source]. | 166 * interpretation of this will vary based on the [source]. |
| 159 */ | 167 */ |
| 160 final description; | 168 final description; |
| 161 | 169 |
| 162 PackageRef(this.name, this.source, this.version, this.description); | 170 PackageRef(this.name, this.source, this.version, this.description); |
| 163 | 171 |
| 164 String toString() => "$name $version from $source ($description)"; | 172 String toString() => "$name $version from $source ($description)"; |
| 165 } | 173 } |
| OLD | NEW |