another approach to the automated building

This commit is contained in:
2016-07-21 19:06:07 +02:00
parent fbdb595cd7
commit 181fdc196e

View File

@@ -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 = ""
} }