Skip to content

Commit

Permalink
Apply recommendations inside incoming.beforeResolve so ordering is pr…
Browse files Browse the repository at this point in the history
…edictable when interacting with other plugins
  • Loading branch information
DanielThomas committed Jun 14, 2016
1 parent 82ae7f9 commit e8891a8
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ public void execute(ResolvableDependencies resolvableDependencies) {
for (Dependency dependency : resolvableDependencies.getDependencies()) {
rsFactory.getRecommendationStrategy().inspectDependency(dependency);
}
}
});

conf.getResolutionStrategy().eachDependency(new Action<DependencyResolveDetails>() {
@Override
public void execute(DependencyResolveDetails details) {
ModuleVersionSelector requested = details.getRequested();
conf.getResolutionStrategy().eachDependency(new Action<DependencyResolveDetails>() {
@Override
public void execute(DependencyResolveDetails details) {
ModuleVersionSelector requested = details.getRequested();

// don't interfere with the way forces trump everything
for (ModuleVersionSelector force : conf.getResolutionStrategy().getForcedModules()) {
if (requested.getGroup().equals(force.getGroup()) && requested.getName().equals(force.getName())) {
return;
// don't interfere with the way forces trump everything
for (ModuleVersionSelector force : conf.getResolutionStrategy().getForcedModules()) {
if (requested.getGroup().equals(force.getGroup()) && requested.getName().equals(force.getName())) {
return;
}
}
String version = getRecommendedVersionRecursive(project, requested);
if(rsFactory.getRecommendationStrategy().recommendVersion(details, version)) {
logger.info("Recommending version " + version + " for dependency " + requested.getGroup() + ":" + requested.getName());
}
}
}
String version = getRecommendedVersionRecursive(project, requested);
if(rsFactory.getRecommendationStrategy().recommendVersion(details, version)) {
logger.info("Recommending version " + version + " for dependency " + requested.getGroup() + ":" + requested.getName());
}
});
}
});
}
Expand Down

0 comments on commit e8891a8

Please sign in to comment.