Use branch names in version. (#3)

This commit is contained in:
Michael N. Lipp 2023-09-12 12:04:49 +02:00 committed by GitHub
commit d9c2f6edd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,7 +63,12 @@ scmVersion {
tag {
def shortened = project.name.startsWith(project.group + ".") ?
project.name.substring(project.group.length() + 1) : project.name
prefix = shortened.replace('.', '-') + "-"
var p = shortened.replace('.', '-') + "-"
if (grgit.branch.current.name != "main"
&& !grgit.branch.current.name.startsWith("release")) {
p = p + grgit.branch.current.name.replace('/', '-') + "-"
}
prefix = p
}
}
version = scmVersion.version