| 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 /// A back-tracking depth-first solver. | 5 /// A back-tracking depth-first solver. |
| 6 /// | 6 /// |
| 7 /// Attempts to find the best solution for a root package's transitive | 7 /// Attempts to find the best solution for a root package's transitive |
| 8 /// dependency graph, where a "solution" is a set of concrete package versions. | 8 /// dependency graph, where a "solution" is a set of concrete package versions. |
| 9 /// A valid solution will select concrete versions for every package reached | 9 /// A valid solution will select concrete versions for every package reached |
| 10 /// from the root package's dependency graph, and each of those packages will | 10 /// from the root package's dependency graph, and each of those packages will |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 message = "* select ${_versions.last.current}"; | 635 message = "* select ${_versions.last.current}"; |
| 636 } | 636 } |
| 637 } else { | 637 } else { |
| 638 // Otherwise, indent it under the current selected package. | 638 // Otherwise, indent it under the current selected package. |
| 639 message = prefixLines(message); | 639 message = prefixLines(message); |
| 640 } | 640 } |
| 641 | 641 |
| 642 // Indent for the previous selections. | 642 // Indent for the previous selections. |
| 643 log.solver(prefixLines(message, prefix: '| ' * _versions.length)); | 643 log.solver(prefixLines(message, prefix: '| ' * _versions.length)); |
| 644 } | 644 } |
| 645 |
| 646 /// Ensures that if [pubspec] has an SDK constraint, then it is compatible |
| 647 /// with the current SDK. |
| 648 /// |
| 649 /// Throws a [SolveFailure] if not. |
| 650 void _validateSdkConstraint(Pubspec pubspec) { |
| 651 if (_overrides.containsKey(pubspec.name)) return; |
| 652 if (pubspec.environment.sdkVersion.allows(sdk.version)) return; |
| 653 |
| 654 throw new BadSdkVersionException(pubspec.name, |
| 655 'Package ${pubspec.name} requires SDK version ' |
| 656 '${pubspec.environment.sdkVersion} but the current SDK is ' |
| 657 '${sdk.version}.'); |
| 658 } |
| 645 } | 659 } |
| 646 | |
| 647 /// Ensures that if [pubspec] has an SDK constraint, then it is compatible | |
| 648 /// with the current SDK. | |
| 649 /// | |
| 650 /// Throws a [SolveFailure] if not. | |
| 651 void _validateSdkConstraint(Pubspec pubspec) { | |
| 652 if (pubspec.environment.sdkVersion.allows(sdk.version)) return; | |
| 653 | |
| 654 throw new BadSdkVersionException(pubspec.name, | |
| 655 'Package ${pubspec.name} requires SDK version ' | |
| 656 '${pubspec.environment.sdkVersion} but the current SDK is ' | |
| 657 '${sdk.version}.'); | |
| 658 } | |
| OLD | NEW |