Skip to content

Commit

Permalink
#145 Better use of streams
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermo-varela committed Apr 25, 2024
1 parent 2255a12 commit e1e0414
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ public List<Module> findModules(
Set<String> compileOnlyDependenciesIds =
excludeCompileOnlyDependencies ? getCompileOnlyDependencyIds(project) : Collections.emptySet();

findResolvedArtifacts(project, allConfigurations, variantAttributes, compileOnlyDependenciesIds)
.forEach(resolvedArtifact -> {
Artifact artifact = new Artifact().setId(getArtifactId(resolvedArtifact))
.setPathname(resolvedArtifact.getFile()).setMonitored(true);
module.addConsumedArtifact(artifact);
});
findResolvedArtifacts(project, allConfigurations, variantAttributes, compileOnlyDependenciesIds).stream()
.map(resolvedArtifact -> new Artifact()
.setId(getArtifactId(resolvedArtifact))
.setPathname(resolvedArtifact.getFile())
.setMonitored(true))
.forEach(module::addConsumedArtifact);

findResolvedDependencies(project, allConfigurations, variantAttributes, excludeCompileOnlyDependencies).forEach(
resolvedDependency -> module.addDependency(processDependency(resolvedDependency, true, new HashSet<>())));
Expand Down

0 comments on commit e1e0414

Please sign in to comment.