| OLD | NEW |
| 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 /** | 5 /** |
| 6 * Attempts to resolve a set of version constraints for a package dependency | 6 * Attempts to resolve a set of version constraints for a package dependency |
| 7 * graph and select an appropriate set of best specific versions for all | 7 * graph and select an appropriate set of best specific versions for all |
| 8 * dependent packages. It works iteratively and tries to reach a stable | 8 * dependent packages. It works iteratively and tries to reach a stable |
| 9 * solution where the constraints of all dependencies are met. If it fails to | 9 * solution where the constraints of all dependencies are met. If it fails to |
| 10 * reach a solution after a certain number of iterations, it assumes the | 10 * reach a solution after a certain number of iterations, it assumes the |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 /** | 324 /** |
| 325 * A constraint that a depending package places on a dependent package has | 325 * A constraint that a depending package places on a dependent package has |
| 326 * changed. | 326 * changed. |
| 327 * | 327 * |
| 328 * This is an abstract class that contains logic for updating the dependency | 328 * This is an abstract class that contains logic for updating the dependency |
| 329 * graph once a dependency has changed. Changing the dependency is the | 329 * graph once a dependency has changed. Changing the dependency is the |
| 330 * responsibility of subclasses. | 330 * responsibility of subclasses. |
| 331 */ | 331 */ |
| 332 abstract class ChangeConstraint implements WorkItem { | 332 abstract class ChangeConstraint implements WorkItem { |
| 333 abstract Future process(VersionSolver solver); | 333 Future process(VersionSolver solver); |
| 334 | 334 |
| 335 abstract void undo(VersionSolver solver); | 335 void undo(VersionSolver solver); |
| 336 | 336 |
| 337 Future _processChange(VersionSolver solver, Dependency oldDependency, | 337 Future _processChange(VersionSolver solver, Dependency oldDependency, |
| 338 Dependency newDependency) { | 338 Dependency newDependency) { |
| 339 var name = newDependency.name; | 339 var name = newDependency.name; |
| 340 var source = oldDependency.source != null ? | 340 var source = oldDependency.source != null ? |
| 341 oldDependency.source : newDependency.source; | 341 oldDependency.source : newDependency.source; |
| 342 var description = oldDependency.description != null ? | 342 var description = oldDependency.description != null ? |
| 343 oldDependency.description : newDependency.description; | 343 oldDependency.description : newDependency.description; |
| 344 var oldConstraint = oldDependency.constraint; | 344 var oldConstraint = oldDependency.constraint; |
| 345 var newConstraint = newDependency.constraint; | 345 var newConstraint = newDependency.constraint; |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 final description1; | 724 final description1; |
| 725 final description2; | 725 final description2; |
| 726 | 726 |
| 727 DescriptionMismatchException(this.package, this.description1, | 727 DescriptionMismatchException(this.package, this.description1, |
| 728 this.description2); | 728 this.description2); |
| 729 | 729 |
| 730 // TODO(nweiz): Dump to YAML when that's supported | 730 // TODO(nweiz): Dump to YAML when that's supported |
| 731 String toString() => "Package '$package' has conflicting descriptions " | 731 String toString() => "Package '$package' has conflicting descriptions " |
| 732 "'${JSON.stringify(description1)}' and '${JSON.stringify(description2)}'"; | 732 "'${JSON.stringify(description1)}' and '${JSON.stringify(description2)}'"; |
| 733 } | 733 } |
| OLD | NEW |