On 29/08/2011, at 3:12 PM, Thor Åge Eldby wrote:
> I'm using test-jars in my build (as described at
> http://mrhaki.blogspot.com/2010/11/gradle-goodness-create-jar-artifact.html).
> Now I need to get access to one of these test-jars from another project.
> However; the jars are added to it's own configuration and the maven plugin
> only uploads default configuration.
>
> Is there anyway to get my test-jar uploaded or are there any other ways to
> create test-jars that work better?
You can configure any configuration to be uploaded by
upload«CapitalisedConfigurationName».
So given:
apply plugin: 'java'
task testJar(type: Jar) {
classifier = 'tests'
from sourceSets.test.classes
}
I'd do the following:
configurations {
tests
published.extendsFrom tests, archives
}
artifacts {
tests testJar
}
uploadPublished {
// maven deployer configuration
}
install {
configuration = configurations.published
}
The reason for the extra “tests” and “published” configurations is that putting
them in the “archives” configuration (where the standard test jar goes) will
mess up project dependencies, putting the test jar on the classpath everywhere
you just want the normal jar. Let me know if you want some more detail on that.
--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email