do not walk project dependencies if not needed

This commit is contained in:
Nikita Skvortsov
2018-05-23 09:55:07 +03:00
parent fec01ebd83
commit e29125ee7b
@@ -137,15 +137,17 @@ class ArtifactQueryResolver {
fileDeps.remove(artifact.getFile());
}
for (ProjectDependency dep : projectDepsToFilter) {
Set<File> depFiles = DependencyResolverImpl.getTargetConfiguration(dep).getAllArtifacts().getFiles().getFiles();
if (!fileDeps.isEmpty()) {
for (ProjectDependency dep : projectDepsToFilter) {
Set<File> depFiles = DependencyResolverImpl.getTargetConfiguration(dep).getAllArtifacts().getFiles().getFiles();
final Set<File> intersection = new LinkedHashSet<File>(Sets.intersection(fileDeps, depFiles));
if (!intersection.isEmpty()) {
DefaultFileCollectionDependency fileCollectionDependency = new DefaultFileCollectionDependency(intersection);
fileCollectionDependency.setScope(myScope);
result.add(fileCollectionDependency);
fileDeps.removeAll(intersection);
final Set<File> intersection = new LinkedHashSet<File>(Sets.intersection(fileDeps, depFiles));
if (!intersection.isEmpty()) {
DefaultFileCollectionDependency fileCollectionDependency = new DefaultFileCollectionDependency(intersection);
fileCollectionDependency.setScope(myScope);
result.add(fileCollectionDependency);
fileDeps.removeAll(intersection);
}
}
}
@@ -158,7 +160,6 @@ class ArtifactQueryResolver {
return result;
}
@NotNull
protected List<Class<? extends Artifact>> additionalArtifactsTypes() {
List<Class<? extends Artifact>> artifactTypes = new ArrayList<Class<? extends Artifact>>();