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

Side by Side Diff: lib/src/solver/backtracking_solver.dart

Issue 1293383006: Dependency overrides override SDK constraints. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | test/dependency_override_test.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 /// 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
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 }
OLDNEW
« no previous file with comments | « no previous file | test/dependency_override_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698