use of org.gradle.api.artifacts.FileCollectionDependency in project gradle by gradle.
the class DefaultLenientConfiguration method visitArtifacts.
/**
* Recursive, includes unsuccessfully resolved artifacts
*
* @param dependencySpec dependency spec
*/
private void visitArtifacts(Spec<? super Dependency> dependencySpec, SelectedArtifactResults artifactResults, VisitedFileDependencyResults fileDependencyResults, ArtifactVisitor visitor) {
// avoid traversing the graph causing the full ResolvedDependency graph to be loaded for the most typical scenario
if (dependencySpec == Specs.SATISFIES_ALL) {
ParallelResolveArtifactSet.wrap(artifactResults.getArtifacts(), buildOperationExecutor).visit(visitor);
return;
}
List<ResolvedArtifactSet> artifactSets = new ArrayList<>();
for (Map.Entry<FileCollectionDependency, Integer> entry : fileDependencyResults.getFirstLevelFiles().entrySet()) {
if (dependencySpec.isSatisfiedBy(entry.getKey())) {
artifactSets.add(artifactResults.getArtifactsWithId(entry.getValue()));
}
}
CachingDirectedGraphWalker<DependencyGraphNodeResult, ResolvedArtifact> walker = new CachingDirectedGraphWalker<>(new ResolvedDependencyArtifactsGraph(artifactSets));
for (DependencyGraphNodeResult node : getFirstLevelNodes(dependencySpec)) {
walker.add(node);
}
walker.findValues();
ParallelResolveArtifactSet.wrap(CompositeResolvedArtifactSet.of(artifactSets), buildOperationExecutor).visit(visitor);
}
Aggregations