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 pub.source; | 5 library pub.source; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
| 9 import 'package:pub_semver/pub_semver.dart'; |
| 10 |
9 import 'package.dart'; | 11 import 'package.dart'; |
10 import 'pubspec.dart'; | 12 import 'pubspec.dart'; |
11 import 'system_cache.dart'; | 13 import 'system_cache.dart'; |
12 import 'version.dart'; | |
13 | 14 |
14 /// A source from which to get packages. | 15 /// A source from which to get packages. |
15 /// | 16 /// |
16 /// Each source has many packages that it looks up using [PackageId]s. Sources | 17 /// Each source has many packages that it looks up using [PackageId]s. Sources |
17 /// that inherit this directly (currently just [PathSource]) are *uncached* | 18 /// that inherit this directly (currently just [PathSource]) are *uncached* |
18 /// sources. They deliver a package directly to the package that depends on it. | 19 /// sources. They deliver a package directly to the package that depends on it. |
19 /// | 20 /// |
20 /// Other sources are *cached* sources. These extend [CachedSource]. When a | 21 /// Other sources are *cached* sources. These extend [CachedSource]. When a |
21 /// package needs a dependency from a cached source, it is first installed in | 22 /// package needs a dependency from a cached source, it is first installed in |
22 /// the [SystemCache] and then acquired from there. | 23 /// the [SystemCache] and then acquired from there. |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 /// according to [parseDescription], although it must still be serializable | 178 /// according to [parseDescription], although it must still be serializable |
178 /// to JSON and YAML. It must also be equal to [id] according to | 179 /// to JSON and YAML. It must also be equal to [id] according to |
179 /// [descriptionsEqual]. | 180 /// [descriptionsEqual]. |
180 /// | 181 /// |
181 /// By default, this just returns [id]. | 182 /// By default, this just returns [id]. |
182 Future<PackageId> resolveId(PackageId id) => new Future.value(id); | 183 Future<PackageId> resolveId(PackageId id) => new Future.value(id); |
183 | 184 |
184 /// Returns the source's name. | 185 /// Returns the source's name. |
185 String toString() => name; | 186 String toString() => name; |
186 } | 187 } |
OLD | NEW |