mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 11:24:56 -04:00
gradle: append -dirty
to version if git status is not clean
This commit is contained in:
parent
824065cb9c
commit
1db1d5bda7
@ -375,12 +375,15 @@ fun loadGit() {
|
|||||||
git = Grgit.open(mapOf("currentDir" to project.rootDir))
|
git = Grgit.open(mapOf("currentDir" to project.rootDir))
|
||||||
val commit = git.log().first()
|
val commit = git.log().first()
|
||||||
val tag = git.tag.list().find { it.commit == commit }
|
val tag = git.tag.list().find { it.commit == commit }
|
||||||
val nextVersion = if (tag != null) {
|
var nextVersion = if (tag != null) {
|
||||||
stable = true
|
stable = true
|
||||||
tag.name
|
tag.name
|
||||||
} else {
|
} else {
|
||||||
commit.abbreviatedId
|
commit.abbreviatedId
|
||||||
}
|
}
|
||||||
|
if (!git.status().isClean) {
|
||||||
|
nextVersion += "-dirty"
|
||||||
|
}
|
||||||
if (project.version != nextVersion) {
|
if (project.version != nextVersion) {
|
||||||
project.version = nextVersion
|
project.version = nextVersion
|
||||||
println("Version changed to ${project.version}")
|
println("Version changed to ${project.version}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user