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

Unified Diff: utils/pub/version_solver.dart

Issue 10701146: Make VersionSolver actually return PackageIds. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Style change Created 8 years, 5 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/tests/pub/version_solver_test.dart » ('j') | utils/tests/pub/version_solver_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/version_solver.dart
diff --git a/utils/pub/version_solver.dart b/utils/pub/version_solver.dart
index 3bee2056ce51cfdadc2e711f233337292c166335..d02dc447b4d67d93b02bb565f69a62baedb35a4f 100644
--- a/utils/pub/version_solver.dart
+++ b/utils/pub/version_solver.dart
@@ -54,8 +54,7 @@
* it fails, the future will complete with a [NoVersionException],
* [DisjointConstraintException], or [CouldNotSolveException].
*/
-Future<Map<String, Version>> resolveVersions(
- SourceRegistry sources, Package root) {
+Future<List<PackageId>> resolveVersions(SourceRegistry sources, Package root) {
return new VersionSolver(sources, root).solve();
}
@@ -129,15 +128,10 @@ class VersionSolver {
_packages[package].version = version;
}
- Map<String, Version> buildResults() {
- var results = <Version>{};
- _packages.forEach((name, dependency) {
- if (dependency.isDependedOn) {
- results[name] = dependency.version;
- }
- });
-
- return results;
+ List<PackageId> buildResults() {
+ return _packages.getValues()
+ .filter((dep) => dep.isDependedOn)
+ .map((dep) => new PackageId(dep.source, dep.version, dep.description));
}
}
« no previous file with comments | « no previous file | utils/tests/pub/version_solver_test.dart » ('j') | utils/tests/pub/version_solver_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698