Skip to content

Commit a907334

Browse files
authored
build: derive version from Git tag via axion-release plugin (#50)
* build: derive version from Git tag via axion-release plugin Replace hardcoded version = '0.1.0' with scmVersion.version from the pl.allegro.tech.build.axion-release plugin. Tag prefix is set to empty string to match existing plain-semver tags (e.g. 0.1.1, not v0.1.1). On a tagged commit the version resolves to the exact tag; on subsequent commits it becomes a SNAPSHOT (e.g. 0.1.2-SNAPSHOT), removing the need to manually update build.gradle before each release. Signed-off-by: Jimisola Laursen <jimisola@jimisola.com> * build: use simple versionCreator to avoid branch name in snapshot version Signed-off-by: Jimisola Laursen <jimisola@jimisola.com> --------- Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
1 parent 21ffe7e commit a907334

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

build.gradle

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ plugins {
44
id 'maven-publish'
55
id 'io.spring.javaformat' version '0.0.47'
66
id 'com.gradle.plugin-publish' version '2.1.1'
7+
id 'pl.allegro.tech.build.axion-release' version '1.18.0'
8+
}
9+
10+
scmVersion {
11+
tag {
12+
prefix = ''
13+
}
14+
versionCreator 'simple'
715
}
816

917
group = 'io.github.reqstool'
10-
version = '0.1.0'
18+
version = scmVersion.version
1119

1220
java {
1321
sourceCompatibility = JavaVersion.VERSION_21

0 commit comments

Comments
 (0)