This message was deleted.
# community-support
s
This message was deleted.
šŸ‘ 1
z
partial answer:
Copy code
configuration
            .incoming
            .resolutionResult
            .rootComponent
but from here, I’m not sure how to get all transitive dependencies
šŸ‘ 1
v
Maybe have a look at
dependencies
and
dependencyInsight
tasks. That's what those should also use.
šŸ‘ 2
z
great advice! this did it:
Copy code
private fun selectDependencies(rootComponent: ResolvedComponentResult): Set<DependencyResult> {
    val selectedDependencies: MutableSet<DependencyResult> = LinkedHashSet()
    eachDependency(
        rootComponent,
        selectedDependencies::add,
        HashSet()
    )
    return selectedDependencies
}
private fun eachDependency(
    node: ResolvedComponentResult,
    dependencyAction: (DependencyResult) -> Unit,
    visited: MutableSet<ResolvedComponentResult>
) {
    if (!visited.add(node)) {
        return
    }
    for (dependencyResult in node.dependencies) {
        dependencyAction.invoke(dependencyResult)
        if (dependencyResult is ResolvedDependencyResult) {
            eachDependency(dependencyResult.selected, dependencyAction, visited)
        }
    }
}