| 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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 /** The names of all the packages that depend on this dependency. */ | 550 /** The names of all the packages that depend on this dependency. */ |
| 551 Collection<String> get dependers => _refs.keys; | 551 Collection<String> get dependers => _refs.keys; |
| 552 | 552 |
| 553 /** | 553 /** |
| 554 * Gets the overall constraint that all packages are placing on this one. | 554 * Gets the overall constraint that all packages are placing on this one. |
| 555 * If no packages have a constraint on this one (which can happen when this | 555 * If no packages have a constraint on this one (which can happen when this |
| 556 * package is in the process of being added to the graph), returns `null`. | 556 * package is in the process of being added to the graph), returns `null`. |
| 557 */ | 557 */ |
| 558 VersionConstraint get constraint { | 558 VersionConstraint get constraint { |
| 559 if (_refs.isEmpty) return null; | 559 if (_refs.isEmpty) return null; |
| 560 return new VersionConstraint.intersect( | 560 return new VersionConstraint.intersection( |
| 561 _refs.values.map((ref) => ref.constraint)); | 561 _refs.values.map((ref) => ref.constraint)); |
| 562 } | 562 } |
| 563 | 563 |
| 564 /// The source of this dependency's package. | 564 /// The source of this dependency's package. |
| 565 Source get source { | 565 Source get source { |
| 566 var canonical = _canonicalRef(); | 566 var canonical = _canonicalRef(); |
| 567 if (canonical == null) return null; | 567 if (canonical == null) return null; |
| 568 return canonical.source; | 568 return canonical.source; |
| 569 } | 569 } |
| 570 | 570 |
| (...skipping 153 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 |