Hi
I'm discovering gradle, and though it is really nice, the learning curve is
steeper than I thought when you start doing funkier stuff. This is obviously
because I am uninformed both in the gradle implementatino and in the
complexity of building engines.
This is my issue
I am trying to factor out common tasks to the parent project, to do this, I
have defined the tasks in the following way, on the root project:
subprojects {
apply plugin: 'groovy'
apply plugin: 'maven'
apply from: "$rootDir/cobertura.gradle"
apply from: "$rootDir/idea.gradle"
repositories {
[...]
}
configurations {
[...]
}
dependencies {
[...]
}
[...(etc, etc) ]
uploadArchives {task->
repositories.mavenDeployer {
uniqueVersion = true
name = 'httpDeployer'
configuration = configurations.deployerJars
def repoURL = "http://artifactory:8081/artifactory"
repoURL += version.contains("-SNAPSHOT") ?
"/libs-snapshots-local" : "/libs-releases-local"
repository(url: repoURL) {
authentication(userName: "a", password: "b")
}
}
}
}
in my subproject's build.gradle, i define:
version = '1.0-SNAPSHOT'
dependencies {
[...]
}
However, the version property seems to not be defined in time for the
uploadJars task to get it from the subproject.
I have been trying different things now, until I realized that I'm possibly
taking the problem the wrong way around.
I just would like to check with the community that this is the way to do
this.
Thanks for any help.
Luis