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 15 matching lines...) Expand all Loading... |
26 /// package. | 26 /// package. |
27 /// | 27 /// |
28 /// - etc. | 28 /// - etc. |
29 /// | 29 /// |
30 /// then the current solution is invalid. It will then backtrack to the most | 30 /// then the current solution is invalid. It will then backtrack to the most |
31 /// recent speculative version choice and try the next one. That becomes the | 31 /// recent speculative version choice and try the next one. That becomes the |
32 /// new in-progress solution and it tries to proceed from there. It will keep | 32 /// new in-progress solution and it tries to proceed from there. It will keep |
33 /// doing this, traversing and then backtracking when it meets a failure until | 33 /// doing this, traversing and then backtracking when it meets a failure until |
34 /// a valid solution has been found or until all possible options for all | 34 /// a valid solution has been found or until all possible options for all |
35 /// speculative choices have been exhausted. | 35 /// speculative choices have been exhausted. |
36 library pub.solver.backtracking_solver; | |
37 | |
38 import 'dart:async'; | 36 import 'dart:async'; |
39 | 37 |
40 import 'package:pub_semver/pub_semver.dart'; | 38 import 'package:pub_semver/pub_semver.dart'; |
41 | 39 |
42 import '../barback.dart' as barback; | 40 import '../barback.dart' as barback; |
43 import '../exceptions.dart'; | 41 import '../exceptions.dart'; |
44 import '../lock_file.dart'; | 42 import '../lock_file.dart'; |
45 import '../log.dart' as log; | 43 import '../log.dart' as log; |
46 import '../package.dart'; | 44 import '../package.dart'; |
47 import '../pubspec.dart'; | 45 import '../pubspec.dart'; |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 void _validateSdkConstraint(Pubspec pubspec) { | 654 void _validateSdkConstraint(Pubspec pubspec) { |
657 if (_overrides.containsKey(pubspec.name)) return; | 655 if (_overrides.containsKey(pubspec.name)) return; |
658 if (pubspec.environment.sdkVersion.allows(sdk.version)) return; | 656 if (pubspec.environment.sdkVersion.allows(sdk.version)) return; |
659 | 657 |
660 throw new BadSdkVersionException(pubspec.name, | 658 throw new BadSdkVersionException(pubspec.name, |
661 'Package ${pubspec.name} requires SDK version ' | 659 'Package ${pubspec.name} requires SDK version ' |
662 '${pubspec.environment.sdkVersion} but the current SDK is ' | 660 '${pubspec.environment.sdkVersion} but the current SDK is ' |
663 '${sdk.version}.'); | 661 '${sdk.version}.'); |
664 } | 662 } |
665 } | 663 } |
OLD | NEW |