Skip to content

Commit

Permalink
fix: packaging breaks on cyclic dependencies
Browse files Browse the repository at this point in the history
Motivation:

- grpc-java has two modules that depend on each other, causing circular
  recursion on the collectDepAndChildren function

Modification:

- stop the recursion if the accumulator already contains a dependency

Result:

- stackoverflowless
  • Loading branch information
notdryft committed Jan 29, 2024
1 parent 18956f6 commit 5e055d6
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ class GatlingEnterprisePackageTask extends Jar {
}

private void collectDepAndChildren(ResolvedDependency dep, Set<ResolvedDependency> acc) {
acc.add(dep)
for (child in dep.children) {
collectDepAndChildren(child, acc)
if (!acc.contains(dep)) {
acc.add(dep)
for (child in dep.children) {
collectDepAndChildren(child, acc)
}
}
}
}

0 comments on commit 5e055d6

Please sign in to comment.