mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-22 10:35:16 +01:00
Fix ci versioning 2
This commit is contained in:
parent
32269cc012
commit
55dbf38144
@ -23,17 +23,23 @@ fun String.runCommand(): String = ProcessBuilder(split("\\s(?=(?:[^'\"`]*(['\"`]
|
|||||||
|
|
||||||
val gitHash = "git rev-parse --verify HEAD".runCommand()
|
val gitHash = "git rev-parse --verify HEAD".runCommand()
|
||||||
val clean = "git status --porcelain".runCommand().isEmpty()
|
val clean = "git status --porcelain".runCommand().isEmpty()
|
||||||
val branch = "git branch --show-current".runCommand()
|
val branch = "git rev-parse --abbrev-ref HEAD".runCommand()
|
||||||
val commitCount = "git rev-list --count HEAD".runCommand()
|
val commitCount = "git rev-list --count HEAD".runCommand()
|
||||||
|
|
||||||
|
if (branch.isEmpty()) {
|
||||||
|
throw IllegalStateException("Could not determine branch name")
|
||||||
|
}
|
||||||
|
|
||||||
println("Git hash: $gitHash" + if (clean) "" else " (dirty)")
|
println("Git hash: $gitHash" + if (clean) "" else " (dirty)")
|
||||||
|
println("Branch: $branch")
|
||||||
|
|
||||||
val releaseProperties = Properties()
|
val releaseProperties = Properties()
|
||||||
releaseProperties.load(file("../release.properties").inputStream())
|
releaseProperties.load(file("../release.properties").inputStream())
|
||||||
|
|
||||||
group = "de.bluecolored.bluemap.core"
|
group = "de.bluecolored.bluemap.core"
|
||||||
version = releaseProperties["version"].toString() + ".$commitCount" +
|
version = releaseProperties["version"].toString() + ".$commitCount" +
|
||||||
if (clean) "" else ".dirty" +
|
(if (clean) "" else ".dirty") +
|
||||||
if (branch == "master") "" else "-$branch"
|
(if (branch == "master") "" else "-$branch")
|
||||||
println("Version: $version")
|
println("Version: $version")
|
||||||
|
|
||||||
val javaTarget = 11
|
val javaTarget = 11
|
||||||
|
Loading…
Reference in New Issue
Block a user