fix(lom): adjust to new SemanticVersion signature
All checks were successful
ci/woodpecker/push/gradle Pipeline was successful
ci/woodpecker/push/pages Pipeline was successful

This commit is contained in:
Johannes Frohnmeyer 2024-06-09 10:06:06 +02:00
parent 0e40cc68fe
commit 2c801ceceb
Signed by: Johannes
GPG Key ID: E76429612C2929F4
2 changed files with 4 additions and 1 deletions

View File

@ -7,6 +7,9 @@ package io.gitlab.jfronny.scripts
* Parsing also supports legacy version strings like v1.2.3, b1.2.3, a1.2.3, rc1.2.3.
*/
data class SemanticVersion(val major: Int, val minor: Int, val patch: Int, val type: VersionType, val typeSupplement: Int?, val build: String?): Comparable<SemanticVersion> {
constructor(major: Int, minor: Int, patch: Int, versionType: VersionType) : this(major, minor, patch, versionType, null, null)
constructor(major: Int, minor: Int, patch: Int) : this(major, minor, patch, VersionType.RELEASE)
init {
require(build == null || buildPattern.matches(build)) { "Illegal build string" }
}

View File

@ -226,7 +226,7 @@ afterEvaluate {
// from fabric-example-mod, enforces modern java
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release.set(if (SemanticVersion.parse(args.minecraftVersion.get()) > SemanticVersion(1, 20, 4, VersionType.RELEASE, null)) 21 else 17)
options.release.set(if (SemanticVersion.parse(args.minecraftVersion.get()) > SemanticVersion(1, 20, 4, VersionType.RELEASE)) 21 else 17)
}
// otherwise we can't easily overwrite the artifacts to publish while keeping dependency metadata