From 2c801cecebc32d22e062e74fd1356c70a663de68 Mon Sep 17 00:00:00 2001 From: JFronny Date: Sun, 9 Jun 2024 10:06:06 +0200 Subject: [PATCH] fix(lom): adjust to new SemanticVersion signature --- .../main/kotlin/io/gitlab/jfronny/scripts/SemanticVersion.kt | 3 +++ lom/src/main/kotlin/lom.gradle.kts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/convention/src/main/kotlin/io/gitlab/jfronny/scripts/SemanticVersion.kt b/convention/src/main/kotlin/io/gitlab/jfronny/scripts/SemanticVersion.kt index ec844cf..4fcfc60 100644 --- a/convention/src/main/kotlin/io/gitlab/jfronny/scripts/SemanticVersion.kt +++ b/convention/src/main/kotlin/io/gitlab/jfronny/scripts/SemanticVersion.kt @@ -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 { + 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" } } diff --git a/lom/src/main/kotlin/lom.gradle.kts b/lom/src/main/kotlin/lom.gradle.kts index a7e5e83..9fbb198 100644 --- a/lom/src/main/kotlin/lom.gradle.kts +++ b/lom/src/main/kotlin/lom.gradle.kts @@ -226,7 +226,7 @@ afterEvaluate { // from fabric-example-mod, enforces modern java tasks.withType().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