From 34038684a7db279075480b33e7b809fd558001e6 Mon Sep 17 00:00:00 2001 From: Ran <43445785+Ran-Mewo@users.noreply.github.com> Date: Fri, 2 May 2025 12:45:18 +1000 Subject: [PATCH] Fix gradle versioning for core application --- .gitlab-ci.yml | 2 +- build.gradle | 50 ++----------------------------------------------- coreSubProjects | 2 +- 3 files changed, 4 insertions(+), 50 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bd7716999..a7e28f306 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,7 +41,7 @@ build: - ./gradlew clean -PmcVer="${MC_VER}" -PinfoGitCommit="${CI_COMMIT_SHA}" -PinfoGitBranch="${CI_COMMIT_BRANCH}" -PinfoBuildSource="GitLab CI (${CI_PIPELINE_ID})" --gradle-user-home cache/; - ./gradlew build -PmcVer="${MC_VER}" -PinfoGitCommit="${CI_COMMIT_SHA}" -PinfoGitBranch="${CI_COMMIT_BRANCH}" -PinfoBuildSource="GitLab CI (${CI_PIPELINE_ID})" --gradle-user-home cache/; - ./gradlew mergeJars -PmcVer="${MC_VER}" -PinfoGitCommit="${CI_COMMIT_SHA}" -PinfoGitBranch="${CI_COMMIT_BRANCH}" -PinfoBuildSource="GitLab CI (${CI_PIPELINE_ID})" --gradle-user-home cache/; - - cp ./fabric/build/libs/* ./forge/build/libs/* ./neoforge/build/libs/* ./Merged/* . || true + - cp ./fabric/build/libs/* ./forge/build/libs/* ./neoforge/build/libs/* ./build/merged/* . || true artifacts: name: "NightlyBuild_${MC_VER}-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" paths: diff --git a/build.gradle b/build.gradle index 3d4a334cb..6f842bfe0 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ plugins { id "com.github.johnrengelman.shadow" version '8.1.1' apply false // Plugin to create merged jars - id "io.github.pacifistmc.forgix" version "1.2.9" + id "io.github.pacifistmc.forgix" version "1.3.2" // Manifold preprocessor id "systems.manifold.manifold-gradle-plugin" version "0.0.2-alpha" @@ -67,43 +67,8 @@ project.gradle.ext.getProperties().each { prop -> // Sets up manifold stuff writeBuildGradlePredefine(rootProject.mcVers, rootProject.mcIndex) - - - // Sets up the version string (the name we use for our jar) rootProject.versionStr = rootProject.mod_version + "-" + rootProject.minecraft_version // + "-" + new Date().format("yyyy_MM_dd_HH_mm") -// Forgix settings (used for merging jars) -forgix { - - String loaderHyphenSeparatedList = ((String)gradle.builds_for).replaceAll(",", "-"); - - group = "com.seibel.distanthorizons" - mergedJarName = "DistantHorizons-${loaderHyphenSeparatedList}-${rootProject.versionStr}.jar" - - if (findProject(":forge")) - forge { - jarLocation = "build/libs/DistantHorizons-forge-${rootProject.versionStr}.jar" - } - - if (findProject(":neoforge")) - custom { - projectName = "neoforge" - jarLocation = "build/libs/DistantHorizons-neoforge-${rootProject.versionStr}.jar" - } - - if (findProject(":fabric")) - fabric { - jarLocation = "build/libs/DistantHorizons-fabric-${rootProject.versionStr}.jar" - } - - if (findProject(":quilt")) - quilt { - jarLocation = "build/libs/DistantHorizons-quilt-${rootProject.versionStr}.jar" - } - - removeDuplicate "com.seibel.distanthorizons" -} - class NativeTransformer implements Transformer { private final HashMap replacements = new HashMap() @@ -561,7 +526,7 @@ allprojects { p -> apply plugin: "maven-publish" archivesBaseName = rootProject.mod_name - version = project.name + "-" + rootProject.versionStr + version = rootProject.versionStr group = rootProject.maven_group // this is the text that appears at the top of the overview (home) page @@ -726,14 +691,3 @@ allprojects { p -> withSourcesJar() } } - - -// Delete the merged folder when running clean -task cleanMergedJars() { - def mergedFolder = file("Merged") - if (mergedFolder.exists()) { - delete(mergedFolder) - } -} -// add cleanMergedJars to the end of the "clean" task -tasks["clean"].finalizedBy(cleanMergedJars) diff --git a/coreSubProjects b/coreSubProjects index ad995544f..4b4f10f5e 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit ad995544f76dd996f17465a343f7c89fef6a85f0 +Subproject commit 4b4f10f5e692b496c58bbe550b5b8802db2e5c07