forked from TAIGA/TAIGA
another approach to the automated building
This commit is contained in:
16
build.gradle
16
build.gradle
@@ -37,26 +37,18 @@ group = "com.sosnitzka" // http://maven.apache.org/guides/mini/guide-naming-conv
|
|||||||
archivesBaseName = "taiga"
|
archivesBaseName = "taiga"
|
||||||
|
|
||||||
task buildInfo {
|
task buildInfo {
|
||||||
def cmd = "git describe --tags \$(git rev-list --tags --max-count=1)"
|
if (System.getenv().TAG != null) {
|
||||||
def proc = cmd.execute()
|
ext.revision = System.getenv().TAG
|
||||||
proc.waitFor()
|
|
||||||
if (proc.exitValue() == 0) {
|
|
||||||
logger.info("Found tag for current version: ${proc.text.trim()}")
|
|
||||||
ext.revision = proc.text.trim()
|
|
||||||
} else {
|
} else {
|
||||||
ext.revision = "snapshot"
|
ext.revision = "snapshot"
|
||||||
logger.info("Could not find tag infos, assume snapshot build")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (System.getenv().BUILD_NUMBER != null) {
|
if (System.getenv().BUILD_NUMBER != null) {
|
||||||
ext.buildNum = System.getenv().BUILD_NUMBER
|
ext.buildNum = System.getenv().BUILD_NUMBER
|
||||||
}
|
}
|
||||||
|
|
||||||
def cmd_changes = "git log \$(git describe --tags --abbrev=0)..\$(git describe --tags \$(git rev-list --tags --max-count=1)) --oneline"
|
if (System.getenv().CHANGES != null) {
|
||||||
def proc_changes = cmd_changes.execute()
|
ext.changes = System.getenv().CHANGES
|
||||||
proc_changes.waitFor()
|
|
||||||
if (proc_changes.exitValue() == 0) {
|
|
||||||
ext.changes = proc_changes.text.trim()
|
|
||||||
} else {
|
} else {
|
||||||
ext.changes = ""
|
ext.changes = ""
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user