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 /// Attempts to resolve a set of version constraints for a package dependency | 5 /// Attempts to resolve a set of version constraints for a package dependency |
6 /// graph and select an appropriate set of best specific versions for all | 6 /// graph and select an appropriate set of best specific versions for all |
7 /// dependent packages. It works iteratively and tries to reach a stable | 7 /// dependent packages. It works iteratively and tries to reach a stable |
8 /// solution where the constraints of all dependencies are met. If it fails to | 8 /// solution where the constraints of all dependencies are met. If it fails to |
9 /// reach a solution after a certain number of iterations, it assumes the | 9 /// reach a solution after a certain number of iterations, it assumes the |
10 /// dependency graph is unstable and reports and error. | 10 /// dependency graph is unstable and reports and error. |
(...skipping 18 matching lines...) Expand all Loading... |
29 /// constraint on that package. I.e. with a shared dependency, we intersect all | 29 /// constraint on that package. I.e. with a shared dependency, we intersect all |
30 /// of the constraints that its depending packages place on it. If that overall | 30 /// of the constraints that its depending packages place on it. If that overall |
31 /// constraint changes (say from "<3.0.0" to "<2.5.0"), then the currently | 31 /// constraint changes (say from "<3.0.0" to "<2.5.0"), then the currently |
32 /// picked version for that package may fall outside of the new constraint. If | 32 /// picked version for that package may fall outside of the new constraint. If |
33 /// that happens, we find the new best version that meets the updated constraint | 33 /// that happens, we find the new best version that meets the updated constraint |
34 /// and then the change the package to use that version. That cycles back up to | 34 /// and then the change the package to use that version. That cycles back up to |
35 /// the beginning again. | 35 /// the beginning again. |
36 library version_solver; | 36 library version_solver; |
37 | 37 |
38 import 'dart:async'; | 38 import 'dart:async'; |
| 39 import 'dart:collection' show Queue; |
39 import 'dart:json' as json; | 40 import 'dart:json' as json; |
40 import 'dart:math'; | 41 import 'dart:math'; |
41 import 'lock_file.dart'; | 42 import 'lock_file.dart'; |
42 import 'log.dart' as log; | 43 import 'log.dart' as log; |
43 import 'package.dart'; | 44 import 'package.dart'; |
44 import 'pubspec.dart'; | 45 import 'pubspec.dart'; |
45 import 'root_source.dart'; | 46 import 'root_source.dart'; |
46 import 'source.dart'; | 47 import 'source.dart'; |
47 import 'source_registry.dart'; | 48 import 'source_registry.dart'; |
48 import 'utils.dart'; | 49 import 'utils.dart'; |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 | 701 |
701 String toString() { | 702 String toString() { |
702 // TODO(nweiz): Dump descriptions to YAML when that's supported. | 703 // TODO(nweiz): Dump descriptions to YAML when that's supported. |
703 return "Incompatible dependencies on '$package':\n" | 704 return "Incompatible dependencies on '$package':\n" |
704 "- '$depender1' depends on it with description " | 705 "- '$depender1' depends on it with description " |
705 "${json.stringify(description1)}\n" | 706 "${json.stringify(description1)}\n" |
706 "- '$depender2' depends on it with description " | 707 "- '$depender2' depends on it with description " |
707 "${json.stringify(description2)}"; | 708 "${json.stringify(description2)}"; |
708 } | 709 } |
709 } | 710 } |
OLD | NEW |