From 9c5cf0087a3b9732eed376268bb5ae6c53482618 Mon Sep 17 00:00:00 2001 From: GlodBlock <1356392126@qq.com> Date: Fri, 20 May 2022 19:14:15 +0800 Subject: [PATCH] only use commit tag as version --- build.gradle | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index 3401a7d28..edb10d839 100644 --- a/build.gradle +++ b/build.gradle @@ -180,11 +180,6 @@ catch (Exception ignored) { } // Pulls version first from the VERSION env and then git tag -String identifiedVersion -String versionOverride = System.getenv("VERSION") ?: null -try { - identifiedVersion = versionOverride == null ? gitVersion() : versionOverride -} catch (Exception ignored) { out.style(Style.Failure).text( 'This mod must be version controlled by Git AND the repository must provide at least one tag,\n' + @@ -192,15 +187,11 @@ catch (Exception ignored) { 'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)' ) versionOverride = 'NO-GIT-TAG-SET' - identifiedVersion = versionOverride } -version = minecraftVersion + '-' + identifiedVersion +String versionTag = gitVersion().split("-")[gitVersion().split("-").length - 1] +version = minecraftVersion + '-' + versionTag ext { - modVersion = identifiedVersion -} - -if(identifiedVersion == versionOverride) { - out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7') + modVersion = versionTag } group = modGroup @@ -569,7 +560,7 @@ publishing { groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons" artifactId = System.getenv("ARTIFACT_ID") ?: project.name // Using the identified version, not project.version as it has the prepended 1.7.10 - version = System.getenv("RELEASE_VERSION") ?: identifiedVersion + version = System.getenv("RELEASE_VERSION") ?: versionTag // remove extra garbage from minecraft and minecraftDeps configuration pom.withXml {