Use better version descriptors.

This commit is contained in:
Michael Lipp 2024-06-10 23:09:48 +02:00
parent bbd9d3baff
commit 6213aa5970
2 changed files with 22 additions and 16 deletions

View file

@ -11,22 +11,24 @@ plugins {
id 'pl.allegro.tech.build.axion-release'
}
def shortened = project.name.startsWith(project.group + ".") ?
project.name.substring(project.group.length() + 1) : project.name
if (shortened == "manager") {
shortened = "manager-app";
}
var tagName = shortened.replace('.', '-') + "-"
if (grgit.branch.current.name != "main"
&& grgit.branch.current.name != "HEAD"
&& !grgit.branch.current.name.startsWith("release")
&& !grgit.branch.current.name.startsWith("develop")) {
tagName = tagName + grgit.branch.current.name.replace('/', '-') + "-"
}
project.ext.tagName = tagName
scmVersion {
versionIncrementer 'incrementMinor'
tag {
def shortened = project.name.startsWith(project.group + ".") ?
project.name.substring(project.group.length() + 1) : project.name
if (shortened == "manager") {
shortened = "manager-app";
}
var p = shortened.replace('.', '-') + "-"
if (grgit.branch.current.name != "main"
&& grgit.branch.current.name != "HEAD"
&& !grgit.branch.current.name.startsWith("release")
&& !grgit.branch.current.name.startsWith("develop")) {
p = p + grgit.branch.current.name.replace('/', '-') + "-"
}
prefix = p
prefix = project.tagName
}
}
project.version = scmVersion.version