ArtifactResolutionResult: tree instead of set


(Martin d'Anjou) #1

When running an ArtifactResolutionQuery, the resulting ArtifactResolutionResult only provides sets. To help users deal with arbitrary dependency trees and compilation order issues, is there a way to obtain a tree of the resolved dependencies, rather than a set?


(Martin d'Anjou) #2

Actually, I have found ResolutionResult.getRoot(). It looks promising.

visitDeps(configurations.compile.incoming.resolutionResult.root)
def visitDeps(ResolvedComponentResult tree) {
    for (child in tree.dependencies) {
        visitDeps(child.selected)
    }
}