Hi,
2009/3/10 tog <[email protected]>
> Hello (correct) mailing list :)
>
> I am quite new to gradle. So far I use it (probably the wrong way) to
> build the groovyws module.
> I say wrong way because I explicitely express all my dependencies !
> May be the right way would be to express only my first level of
> dependencies and then let gradle retrieve the dependencies of my
> dependencies. But being quite ignorant to Maven as well, I don't know
> what to do anyway ...
Normally it should be sufficient to declare your first level depdendencies,
transitive ones are being pulled in by default.
>
>
> My question (as stated in the subject) is related to version ...
> gradle seems to understand version like 0.5.0 but raise an error for
> something like 0.5.0-RC1. What is the proper way to set such a version
> number ? (or for generating a snapshot)
If you are publishing to a maven repo you can do the following:
set your version to :
version = '0.1-SNAPSHOT'
in your dependencies section specify additional transport dependencies if
needed:
dependencies {
addMavenRepo()
addConfiguration('deployerJars')
deployerJars "org.apache.maven.wagon:wagon-ssh:1.0-beta-2"
}
in your uploadLibs:
uploadLibs {
uploadResolvers.addMavenDeployer('repo-deployer') {
addProtocolProviderJars(dependencies.resolve('deployerJars'))
repository(url: '
http://repo-server/nexus/content/repositories/releases/') {
authentication(userName: "${username}", password: "${password}")
}
snapshotRepository(url: '
http://repo-server/nexus/content/repositories/snapshots/') {
authentication(userName: "${username}", password: "${password}")
}
}
}
with the ${username} and ${password} defined in a
USER_HOME/.gradle/gradle.properties:
username = myUsername
password = myPassword
By setting the version to '0.1-SNAPSHOT' the maven deployer
will automatically select the snaptshot repository and publish timestamped
artifacts.
if you add the following, and run gradle release than version doesn't have
the SNAPSHOT indicator and the maven publisher will publish to the release
repo:
build.taskGraph.whenReady {graph ->
if (graph.hasTask(':release')) {
version = '0.1'
}
}
createTask('release', dependsOn: ['uploadLibs']) {
}
For more information about interacting with maven repositories please have a
look at the userguide:
http://www.gradle.org/userguide/0.5.2/userguidech15.html#x44-10700015.2
>
> My last question would be to know if there has been any attempt to
> integrate gradle with tools like hudson ?
There is a Gradle plugin available for Hudson you can find it here:
http://wiki.hudson-ci.org/display/HUDSON/Gradle+Plugin
>
>
> Cheers
> Guillaume
>
> --
>
> PGP KeyID: 1024D/47172155
> FingerPrint: C739 8B3C 5ABF 127F CCFA 5835 F673 370B 4717 2155
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
Thx,
Tom