How do I get the resolution report?


(Justin Ryan) #1

In the documentation, it mentions being able to get a “resolution result”, but it doesn’t say where it can be gotten from.

Since Gradle 1.2 there is also a new programmatic API to access the resolved dependency information. The dependency reports (see the previous paragraph) are using this API behind the hood. The API lets you to walk the resolved dependency graph and provides information about the dependencies. With the coming releases the API will grow to provide more information about the resolution result. For more information about the API please refer to the javadocs on ResolvableDependencies.getResolutionResult().

One example on stackoverflow pointed to conf.resolvedConfiguration.resolutionResult, but there’s mention of resolutionResult on the Resolved Configuration (http://www.gradle.org/docs/current/javadoc/org/gradle/api/artifacts/ResolvedConfiguration.html) javadoc page. What is the parent object that a resolution result comes from? And is it going to be for a single configuration?


(Luke Daley) #2

There’s a complete example here…

http://www.gradle.org/docs/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html


(Justin Ryan) #3

Thanks for the link. It doesn’t make references to ResolvableDependencies or resolutionResult, which is what is in the documentation. I’m just trying to make the connection from Project to a resolutionResult, which that page does’t do.

Likewise, that documentation is helpful for making resolution rules. I’m looking for a final resolve, and not how to affect it. And I need it outside of resolutionStrategy closure, since I need to use the resolved values in a project.publishing.publications.ivy.descriptor.withXml closure.


(Luke Daley) #4

Sorry, I didn’t read well enough.

‘configurations.compile.incoming’ gives you a ‘ResolvableDependencies’, and you can get ‘resolutionResult’ on that.


#5

I think you want ‘configurations.compile.incoming.resolutionResult’: Configuration.incoming is perhaps a little obscure.


(Justin Ryan) #6

Thank! That’s it.

Wow, the ResolutionResult data structure is 1000% better than the Ivy data structures.