mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 10:49:00 +00:00
Fix VersionSelection.getDependenciesOn.
R=rnystrom@google.com Review URL: https://codereview.chromium.org//1130263003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45803 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
3f694c96ba
commit
ee60510cac
1 changed files with 6 additions and 6 deletions
|
@ -61,7 +61,7 @@ class VersionSelection {
|
|||
// Add all of [id]'s dependencies to [_dependencies], as well as to
|
||||
// [_unselected] if necessary.
|
||||
await Future.forEach(await _solver.depsFor(id), (dep) async {
|
||||
var deps = getDependencies(dep.name);
|
||||
var deps = getDependenciesOn(dep.name);
|
||||
deps.add(new Dependency(id, dep));
|
||||
|
||||
// If this is the first dependency on this package, add it to the
|
||||
|
@ -84,7 +84,7 @@ class VersionSelection {
|
|||
await _unselected.add(id.toRef());
|
||||
|
||||
for (var dep in await _solver.depsFor(id)) {
|
||||
var deps = getDependencies(dep.name);
|
||||
var deps = getDependenciesOn(dep.name);
|
||||
deps.removeLast();
|
||||
|
||||
if (deps.isEmpty) {
|
||||
|
@ -116,13 +116,13 @@ class VersionSelection {
|
|||
/// can have a bunch of dependencies back onto the root package as long as
|
||||
/// they all agree with each other.
|
||||
Dependency getRequiredDependency(String name) {
|
||||
return getDependencies(name)
|
||||
return getDependenciesOn(name)
|
||||
.firstWhere((dep) => !dep.dep.isRoot, orElse: () => null);
|
||||
}
|
||||
|
||||
/// Gets the combined [VersionConstraint] currently placed on package [name].
|
||||
VersionConstraint getConstraint(String name) {
|
||||
var constraint = getDependencies(name)
|
||||
var constraint = getDependenciesOn(name)
|
||||
.map((dep) => dep.dep.constraint)
|
||||
.fold(VersionConstraint.any, (a, b) => a.intersect(b));
|
||||
|
||||
|
@ -135,11 +135,11 @@ class VersionSelection {
|
|||
|
||||
/// Returns a string description of the dependencies on [name].
|
||||
String describeDependencies(String name) =>
|
||||
getDependencies(name).map((dep) => " $dep").join('\n');
|
||||
getDependenciesOn(name).map((dep) => " $dep").join('\n');
|
||||
|
||||
/// Gets the list of known dependencies on package [name].
|
||||
///
|
||||
/// Creates an empty list if needed.
|
||||
List<Dependency> getDependencies(String name) =>
|
||||
List<Dependency> getDependenciesOn(String name) =>
|
||||
_dependencies.putIfAbsent(name, () => <Dependency>[]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue