Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
Fix tag versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
yschimke committed Dec 26, 2021
1 parent 6c9abc7 commit f533a34
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import net.nemerosa.versioning.ReleaseInfo
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.apache.tools.ant.taskdefs.condition.Os

Expand All @@ -14,6 +15,18 @@ plugins {
id("org.jreleaser") version "0.9.1"
}

versioning {
scm = "git"
releaseParser = KotlinClosure2<net.nemerosa.versioning.SCMInfo, String, ReleaseInfo>({ scmInfo, _ ->
if (scmInfo.tag != null && scmInfo.tag.startsWith("v")) {
ReleaseInfo("release", scmInfo.tag.substring(1))
} else {
val parts = scmInfo.branch.split("/", limit = 2)
ReleaseInfo(parts[0], parts.getOrNull(1) ?: "")
}
})
}

application {
mainClass.set("com.baulsupp.okurl.MainKt")
}
Expand Down

0 comments on commit f533a34

Please sign in to comment.