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

Unified Diff: utils/pub/pubspec.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/package.dart ('k') | utils/pub/source.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/pubspec.dart
diff --git a/utils/pub/pubspec.dart b/utils/pub/pubspec.dart
index 04c942e60887de8c34c4708704345e2b70cbf279..d038779acd5ffc17cf125ddb657aba43926b141d 100644
--- a/utils/pub/pubspec.dart
+++ b/utils/pub/pubspec.dart
@@ -25,7 +25,7 @@ class Pubspec {
*/
List<PackageRef> dependencies;
- Pubspec._(this.version, this.dependencies);
+ Pubspec(this.version, this.dependencies);
Pubspec.empty()
: version = Version.none,
@@ -59,21 +59,18 @@ class Pubspec {
}
dependencyEntries.forEach((name, spec) {
- var description, source;
+ var description, source, versionConstraint;
if (spec == null) {
description = name;
source = sources.defaultSource;
} else if (spec is String) {
description = name;
source = sources.defaultSource;
- // TODO(rnystrom): Support parsing version constraints like
- // ">= 2.0.0 < 3.1.3".
- version = new Version.parse(spec);
+ versionConstraint = new VersionConstraint.parse(spec);
} else if (spec is Map) {
if (spec.containsKey('version')) {
- // TODO(rnystrom): Support parsing version constraints like
- // ">= 2.0.0 < 3.1.3".
- version = new Version.parse(spec.remove('version'));
+ versionConstraint = new VersionConstraint.parse(
+ spec.remove('version'));
}
var sourceNames = spec.getKeys();
@@ -98,10 +95,10 @@ class Pubspec {
source.validateDescription(description);
dependencies.add(new PackageRef(
- name, source, Version.none, description));
+ name, source, versionConstraint, description));
});
}
- return new Pubspec._(version, dependencies);
+ return new Pubspec(version, dependencies);
}
}
« no previous file with comments | « utils/pub/package.dart ('k') | utils/pub/source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698