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

Unified Diff: utils/pub/package.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 | « no previous file | utils/pub/pubspec.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/package.dart
diff --git a/utils/pub/package.dart b/utils/pub/package.dart
index 7bb50dfa653420c36e12a8b79f5ab9bc471dc0e5..1449b9e8921e944d656f312b075e28c3a1ac33aa 100644
--- a/utils/pub/package.dart
+++ b/utils/pub/package.dart
@@ -62,6 +62,13 @@ class Package {
Collection<PackageRef> get dependencies() => pubspec.dependencies;
/**
+ * Constructs a package with the given name and pubspec. The package will
+ * no directory associated with it.
+ */
+ Package.inMemory(this.name, this.pubspec)
+ : dir = null;
+
+ /**
* Constructs a package. This should not be called directly. Instead, acquire
* packages from [load()].
*/
@@ -72,7 +79,7 @@ class Package {
/**
* Returns a debug string for the package.
*/
- String toString() => '$name ($dir)';
+ String toString() => '$name $version ($dir)';
}
/**
@@ -159,7 +166,7 @@ class PackageRef {
/**
* The allowed package versions.
*/
- final VersionConstraint version;
+ final VersionConstraint constraint;
/**
* The metadata used to identify the package being referenced. The
@@ -167,7 +174,7 @@ class PackageRef {
*/
final description;
- PackageRef(this.name, this.source, this.version, this.description);
+ PackageRef(this.name, this.source, this.constraint, this.description);
- String toString() => "$name $version from $source ($description)";
+ String toString() => "$name $constraint from $source ($description)";
}
« no previous file with comments | « no previous file | utils/pub/pubspec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698