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 library pub.solver.backtracking_solver; | 5 library pub.solver.backtracking_solver; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection' show Queue; | 8 import 'dart:collection' show Queue; |
9 | 9 |
10 import '../barback.dart' as barback; | 10 import '../barback.dart' as barback; |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 /// descriptions, not the version. | 638 /// descriptions, not the version. |
639 void _validateDependency(Dependency dependency) { | 639 void _validateDependency(Dependency dependency) { |
640 var dep = dependency.dep; | 640 var dep = dependency.dep; |
641 | 641 |
642 // Make sure the dependencies agree on source and description. | 642 // Make sure the dependencies agree on source and description. |
643 var required = _getRequired(dep.name); | 643 var required = _getRequired(dep.name); |
644 if (required == null) return; | 644 if (required == null) return; |
645 | 645 |
646 // Make sure all of the existing sources match the new reference. | 646 // Make sure all of the existing sources match the new reference. |
647 if (required.dep.source != dep.source) { | 647 if (required.dep.source != dep.source) { |
648 _solver.logSolve( | 648 _solver.logSolve('source mismatch on ${dep.name}: ${required.dep.source} ' |
649 'source mismatch on ${dep.name}: ${required.dep.source} ' '!= ${dep.so
urce}'); | 649 '!= ${dep.source}'); |
650 throw new SourceMismatchException(dep.name, [required, dependency]); | 650 throw new SourceMismatchException(dep.name, [required, dependency]); |
651 } | 651 } |
652 | 652 |
653 // Make sure all of the existing descriptions match the new reference. | 653 // Make sure all of the existing descriptions match the new reference. |
654 var source = _solver.sources[dep.source]; | 654 var source = _solver.sources[dep.source]; |
655 if (!source.descriptionsEqual(dep.description, required.dep.description)) { | 655 if (!source.descriptionsEqual(dep.description, required.dep.description)) { |
656 _solver.logSolve('description mismatch on ${dep.name}: ' | 656 _solver.logSolve('description mismatch on ${dep.name}: ' |
657 '${required.dep.description} != ${dep.description}'); | 657 '${required.dep.description} != ${dep.description}'); |
658 throw new DescriptionMismatchException(dep.name, [required, dependency]); | 658 throw new DescriptionMismatchException(dep.name, [required, dependency]); |
659 } | 659 } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 /// Ensures that if [pubspec] has an SDK constraint, then it is compatible | 806 /// Ensures that if [pubspec] has an SDK constraint, then it is compatible |
807 /// with the current SDK. | 807 /// with the current SDK. |
808 /// | 808 /// |
809 /// Throws a [SolveFailure] if not. | 809 /// Throws a [SolveFailure] if not. |
810 void _validateSdkConstraint(Pubspec pubspec) { | 810 void _validateSdkConstraint(Pubspec pubspec) { |
811 if (pubspec.environment.sdkVersion.allows(sdk.version)) return; | 811 if (pubspec.environment.sdkVersion.allows(sdk.version)) return; |
812 | 812 |
813 throw new BadSdkVersionException( | 813 throw new BadSdkVersionException( |
814 pubspec.name, | 814 pubspec.name, |
815 'Package ${pubspec.name} requires SDK version ' | 815 'Package ${pubspec.name} requires SDK version ' |
816 '${pubspec.environment.sdkVersion} but the current SDK is ' '${sdk.version
}.'); | 816 '${pubspec.environment.sdkVersion} but the current SDK is ' |
| 817 '${sdk.version}.'); |
817 } | 818 } |
OLD | NEW |