Index: utils/pub/source.dart |
diff --git a/utils/pub/source.dart b/utils/pub/source.dart |
index 082d6a9b7a988763bf37cef688501fa19473e5c0..8dbe1546343583b5c54c6e0de676f2de8e451b99 100644 |
--- a/utils/pub/source.dart |
+++ b/utils/pub/source.dart |
@@ -5,6 +5,8 @@ |
#library('source'); |
#import('package.dart'); |
+#import('pubspec.dart'); |
+#import('version.dart'); |
/** |
* A source from which to install packages. |
@@ -30,6 +32,28 @@ class Source { |
abstract bool get shouldCache(); |
/** |
+ * Get the list of all versions that exist for package [name]. |
+ * |
+ * Note that this does *not* require the packages to be installed, which is |
+ * the point. This is used during version resolution to determine which |
+ * package versions are available to be installed (or already installed). |
+ */ |
+ Future<List<Version>> getVersions(String name) { |
+ // TODO(rnystrom): Do something better here. |
+ throw "Source $name doesn't support versioning."; |
+ } |
+ |
+ /** |
+ * Loads the (possibly remote) pubspec for the desired [version] of the named |
+ * [package]. This will be called for packages that have not yet been |
+ * installed during the version resolution process. |
+ */ |
+ Future<Pubspec> describe(String package, Version version) { |
+ // TODO(rnystrom): Figure out how non-default sources should handle this. |
+ throw "Source $name doesn't support versioning."; |
+ } |
+ |
+ /** |
* Installs the package identified by [id] to [path]. Returns a [Future] that |
* completes when the installation was finished. The [Future] should resolve |
* to true if the package was found in the source and false if it wasn't. For |