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

Side by Side Diff: utils/pub/version_solver.dart

Issue 11865005: Remove Futures class, move methods to Future. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/pub/validator/directory.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Attempts to resolve a set of version constraints for a package dependency 5 /// Attempts to resolve a set of version constraints for a package dependency
6 /// graph and select an appropriate set of best specific versions for all 6 /// graph and select an appropriate set of best specific versions for all
7 /// dependent packages. It works iteratively and tries to reach a stable 7 /// dependent packages. It works iteratively and tries to reach a stable
8 /// solution where the constraints of all dependencies are met. If it fails to 8 /// solution where the constraints of all dependencies are met. If it fails to
9 /// reach a solution after a certain number of iterations, it assumes the 9 /// reach a solution after a certain number of iterations, it assumes the
10 /// dependency graph is unstable and reports and error. 10 /// dependency graph is unstable and reports and error.
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 Future process(VersionSolver solver) { 248 Future process(VersionSolver solver) {
249 log.fine("Changing $package to version $version."); 249 log.fine("Changing $package to version $version.");
250 250
251 var dependency = solver.getDependency(package); 251 var dependency = solver.getDependency(package);
252 var oldVersion = dependency.version; 252 var oldVersion = dependency.version;
253 solver.setVersion(package, version); 253 solver.setVersion(package, version);
254 254
255 // The dependencies between the old and new version may be different. Walk 255 // The dependencies between the old and new version may be different. Walk
256 // them both and update any constraints that differ between the two. 256 // them both and update any constraints that differ between the two.
257 return Futures.wait([ 257 return Future.wait([
258 getDependencyRefs(solver, oldVersion), 258 getDependencyRefs(solver, oldVersion),
259 getDependencyRefs(solver, version)]).then((list) { 259 getDependencyRefs(solver, version)]).then((list) {
260 var oldDependencyRefs = list[0]; 260 var oldDependencyRefs = list[0];
261 var newDependencyRefs = list[1]; 261 var newDependencyRefs = list[1];
262 262
263 for (var oldRef in oldDependencyRefs.values) { 263 for (var oldRef in oldDependencyRefs.values) {
264 if (newDependencyRefs.containsKey(oldRef.name)) { 264 if (newDependencyRefs.containsKey(oldRef.name)) {
265 // The dependency is in both versions of this package, but its 265 // The dependency is in both versions of this package, but its
266 // constraint may have changed. 266 // constraint may have changed.
267 var newRef = newDependencyRefs.remove(oldRef.name); 267 var newRef = newDependencyRefs.remove(oldRef.name);
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 700
701 String toString() { 701 String toString() {
702 // TODO(nweiz): Dump descriptions to YAML when that's supported. 702 // TODO(nweiz): Dump descriptions to YAML when that's supported.
703 return "Incompatible dependencies on '$package':\n" 703 return "Incompatible dependencies on '$package':\n"
704 "- '$depender1' depends on it with description " 704 "- '$depender1' depends on it with description "
705 "${json.stringify(description1)}\n" 705 "${json.stringify(description1)}\n"
706 "- '$depender2' depends on it with description " 706 "- '$depender2' depends on it with description "
707 "${json.stringify(description2)}"; 707 "${json.stringify(description2)}";
708 } 708 }
709 } 709 }
OLDNEW
« no previous file with comments | « utils/pub/validator/directory.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698