VM-Operator/buildSrc/src/org.jdrupes.vmoperator.versioning-conventions.gradle

36 lines
1,018 B
Groovy
Raw Normal View History

2023-09-22 16:50:38 +02:00
/*
* 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'
}
2024-06-10 23:09:48 +02:00
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
2023-09-22 16:50:38 +02:00
scmVersion {
versionIncrementer 'incrementMinor'
tag {
2024-06-10 23:09:48 +02:00
prefix = project.tagName
2023-09-22 16:50:38 +02:00
}
}
2024-06-09 22:54:42 +02:00
project.version = scmVersion.version
2023-09-22 16:50:38 +02:00
ext.isSnapshot = version.endsWith('-SNAPSHOT')