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

Unified Diff: utils/pub/source.dart

Issue 10540151: First pass at version constraint solver. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Request all versions from the source, and not just the best. Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/pub/pubspec.dart ('k') | utils/pub/version.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « utils/pub/pubspec.dart ('k') | utils/pub/version.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698