Merge branch 'SPR-10124' into cleanup-3.2.x

* SPR-10124:
  Polish support for topic branch-specific versions
This commit is contained in:
Chris Beams 2013-01-03 22:09:18 +01:00
commit ab16af5c50
1 changed files with 19 additions and 10 deletions

View File

@ -9,6 +9,9 @@ buildscript {
}
configure(allprojects) { project ->
group = "org.springframework"
version = qualifyVersionIfNecessary(version)
ext.aspectjVersion = "1.7.1"
ext.easymockVersion = "2.5.2"
ext.hsqldbVersion = "1.8.0.10"
@ -16,14 +19,6 @@ configure(allprojects) { project ->
ext.slf4jVersion = "1.6.1"
ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
if (rootProject.hasProperty("VERSION_QUALIFIER")) {
def qualifier = rootProject.getProperty("VERSION_QUALIFIER")
if (qualifier.startsWith("SPR-")) { // topic branch, e.g. SPR-1234
// replace 3.2.0.BUILD-SNAPSHOT for 3.2.0.SPR-1234-SNAPSHOT
version = version.replace('BUILD', qualifier)
}
}
apply plugin: "propdeps"
apply plugin: "java"
apply plugin: "propdeps-eclipse"
@ -31,8 +26,6 @@ configure(allprojects) { project ->
apply plugin: "test-source-set-dependencies"
apply from: "${gradleScriptDir}/ide.gradle"
group = "org.springframework"
compileJava {
sourceCompatibility=1.5
targetCompatibility=1.5
@ -958,3 +951,19 @@ configure(rootProject) {
}
}
}
/*
* Support publication of artifacts versioned by topic branch.
* CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time.
* If <TOPIC> starts with 'SPR-', change version
* from BUILD-SNAPSHOT => <TOPIC>-SNAPSHOT
* e.g. 3.2.1.BUILD-SNAPSHOT => 3.2.1.SPR-1234-SNAPSHOT
*/
def qualifyVersionIfNecessary(version) {
if (rootProject.hasProperty("BRANCH_NAME")) {
def qualifier = rootProject.getProperty("BRANCH_NAME")
if (qualifier.startsWith("SPR-")) {
version = version.replace('BUILD', qualifier)
}
}
}