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.version_solver; | 5 library pub.solver.version_solver; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import "dart:convert"; | 8 import "dart:convert"; |
9 | 9 |
10 import 'package:pub_semver/pub_semver.dart'; | 10 import 'package:pub_semver/pub_semver.dart'; |
(...skipping 14 matching lines...) Expand all Loading... |
25 /// that those dependencies place on each other and the requirements imposed by | 25 /// that those dependencies place on each other and the requirements imposed by |
26 /// [lockFile]. | 26 /// [lockFile]. |
27 /// | 27 /// |
28 /// If [useLatest] is given, then only the latest versions of the referenced | 28 /// If [useLatest] is given, then only the latest versions of the referenced |
29 /// packages will be used. This is for forcing an upgrade to one or more | 29 /// packages will be used. This is for forcing an upgrade to one or more |
30 /// packages. | 30 /// packages. |
31 /// | 31 /// |
32 /// If [upgradeAll] is true, the contents of [lockFile] are ignored. | 32 /// If [upgradeAll] is true, the contents of [lockFile] are ignored. |
33 Future<SolveResult> resolveVersions(SolveType type, SourceRegistry sources, | 33 Future<SolveResult> resolveVersions(SolveType type, SourceRegistry sources, |
34 Package root, {LockFile lockFile, List<String> useLatest}) { | 34 Package root, {LockFile lockFile, List<String> useLatest}) { |
35 if (lockFile == null) lockFile = new LockFile.empty(); | 35 if (lockFile == null) lockFile = new LockFile.empty(sources); |
36 if (useLatest == null) useLatest = []; | 36 if (useLatest == null) useLatest = []; |
37 | 37 |
38 return log.progress('Resolving dependencies', () { | 38 return log.progress('Resolving dependencies', () { |
39 return new BacktrackingSolver(type, sources, root, lockFile, useLatest) | 39 return new BacktrackingSolver(type, sources, root, lockFile, useLatest) |
40 .solve(); | 40 .solve(); |
41 }); | 41 }); |
42 } | 42 } |
43 | 43 |
44 /// The result of a version resolution. | 44 /// The result of a version resolution. |
45 class SolveResult { | 45 class SolveResult { |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 | 478 |
479 DependencyNotFoundException(String package, this._innerException, | 479 DependencyNotFoundException(String package, this._innerException, |
480 Iterable<Dependency> dependencies) | 480 Iterable<Dependency> dependencies) |
481 : super(package, dependencies); | 481 : super(package, dependencies); |
482 | 482 |
483 /// The failure isn't because of the version of description of the package, | 483 /// The failure isn't because of the version of description of the package, |
484 /// it's the package itself that can't be found, so just show the name and no | 484 /// it's the package itself that can't be found, so just show the name and no |
485 /// descriptive details. | 485 /// descriptive details. |
486 String _describeDependency(PackageDep dep) => ""; | 486 String _describeDependency(PackageDep dep) => ""; |
487 } | 487 } |
OLD | NEW |