I know how to obtain the File object of a resolved dependency by iterating the then examining the name.
And that works fine, but there must a way to obtain the exact dependency I want (by its group: and name: ) WITHOUT looping and “iffing”.
I have struggled with this for a long time and always end up writing the looping code.
I want the full path (/home/foo/.gradle/caches/…) of the dependency
configurations.spectrumDependency.resolvedConfiguration.resolvedArtifacts.each { dep ->
logger.info ‘found dependency ------’ + dep.name
if ( dep.name == ‘my-artifact’ ) …
}
Any guidance to point me to the right API or examples would be appreciated.
Thanks