Hi,
I am using an existing ivy repository that uses ivy types to group files
within a single configuration:
eg ivy.xml snippet
--
<configurations>
<conf name="default"/>
</configurations>
<publications>
<artifact name="junit"
type="jar"
conf="default"/>
<artifact name="junit-src"
type="source"
ext="zip"
conf="*"/>
<artifact name="junit-license"
type="license"
ext="html"
conf="*"/>
</publications>
--
I could not see an obvious way to restrict a configuration by ivy type, but
I eventually discovered that I could extract a subset of files from the
configuration using the following gradle code:
--
task resolve << {
Set<ResolvedArtifact> artifacts =
configurations.testCompile.resolvedConfiguration.resolvedArtifacts
def typedArtifacts = artifacts.findAll { artifact ->
artifact.type == 'license'
}
println("Artifacts = " +
ResolvedDependencies.getFilesFromArtifacts(typedArtifacts))
}
--
Is this code ok (is it expected that it will continue to be in the
interface), or is there a better way to work with ivy types?
Is there a way to specify that compilation tasks etc only use specific ivy
types from a configuration, or are there plans/ideas to implement something
to allow this sort of functionality.
Thanks,
Ross