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