fix(autoversion): add missing hyphen
Some checks failed
ci/woodpecker/push/pages Pipeline was successful
ci/woodpecker/push/gradle Pipeline failed

This commit is contained in:
Johannes Frohnmeyer 2024-09-30 18:31:51 +02:00
parent 997c3f80a9
commit fcaf3ed19c
Signed by: Johannes
GPG Key ID: E76429612C2929F4
2 changed files with 3 additions and 2 deletions

View File

@ -18,7 +18,7 @@ data class SemanticVersion(val major: Int, val minor: Int, val patch: Int, val t
override fun toString(): String {
return "$major.$minor.$patch" + when (type) {
VersionType.RELEASE -> typeSupplement ?: ""
VersionType.RELEASE -> typeSupplement?.let { "-$it" } ?: ""
else -> "-${type.semanticName}" + if(typeSupplement != null) ".$typeSupplement" else ""
} + if (build == null) "" else "+$build"
}
@ -34,6 +34,7 @@ data class SemanticVersion(val major: Int, val minor: Int, val patch: Int, val t
}
fun withType(versionType: VersionType, typeSupplement: String? = null) = SemanticVersion(major, minor, patch, versionType, typeSupplement, build)
fun withBuild(build: String?) = SemanticVersion(major, minor, patch, type, typeSupplement, build)
companion object {
private val identifier = Regex("[a-zA-Z1-9][a-zA-Z0-9]*")

View File

@ -38,7 +38,7 @@ if (File(projectDir, ".git").exists()) {
.map { msg -> CommitType.from(msg) { logger.warn(it) } }
.max { o1, o2 -> o1.compareTo(o2) }
.getOrDefault(CommitType.FIX)
nextRelease = parsedVersion.incrementBy(type)
nextRelease = parsedVersion.incrementBy(type, nprop("buildClassifier"))
}
} else {
changelog += "Commits after inception:\n"