VM-Operator/buildSrc/src/org.jdrupes.vmoperator.versioning-conventions.gradle
Michael N. Lipp 6c250d4656
Some checks failed
Java CI with Gradle / build (push) Has been cancelled
Fix release versions.
2024-06-01 14:28:57 +02:00

33 lines
1 KiB
Groovy

/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/
plugins {
// Required by axion-release
id 'org.ajoberstar.grgit'
// Git based versioning
id 'pl.allegro.tech.build.axion-release'
}
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
}
}
project.version = scmVersion.version
ext.isSnapshot = version.endsWith('-SNAPSHOT')