I can iterate files that are part of my configuration by using:
task listJars << {
configurations.compile.resolvedConfiguration.resolvedArtifacts.each { artifact ->
println artifact
}
}
This tells me details like artifact group, name, version, ext, type etc. I also need sha1 value of the artifact. I looked at the absolutePath and here is absolutePath of one of the files in cache:
c:\home\.gradle\caches\artifacts-15\filestore\com.xxx\ant\1.8.4\jar\8acff3fb57e74bc062d4675d9dcfaffa0d524972\ant-1.8.4.jar
Based on the absolutePath of the file I can verify that the magic numbers (8acff3fb57e74bc062d4675d9dcfaffa0d524972) preceding the jar name are the sha1 values maintained in Artifactory. Are there any APIs exposed to get the sha1 value? Can I always rely on the absolutePath to derive the sha1 value (or this path would be internal to gradle and may change in future)?
Thanks, -Harshad.