diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e4b9db183..2b2e0acab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,9 +33,9 @@ build: - MC_VER: ["1.16.5", "1.17.1", "1.18.2", "1.19.2", "1.19.4", "1.20.1", "1.20.2"] script: # this both runs the unit tests and assembles the code - - ./gradlew clean -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="Unavailable (built by Gitlab CI)" --gradle-user-home cache/; - - ./gradlew build -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="Unavailable (built by Gitlab CI)" --gradle-user-home cache/; - - ./gradlew mergeJars -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="Unavailable (built by Gitlab CI)" --gradle-user-home cache/; + - ./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/; artifacts: name: "NightlyBuild_${MC_VER}-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" paths: diff --git a/build.gradle b/build.gradle index e57e72841..45f6fc5ba 100644 --- a/build.gradle +++ b/build.gradle @@ -359,28 +359,15 @@ subprojects { p -> // TODOI: Find something we can use so we can basically re-map only when the jar is shadowed and relocated // println p.tasks.findByName('shadowJar') - // Gets git info for the project - def git_main_commit = "Git_not_found" - def git_core_commit = "Git_not_found" - def git_main_branch = "Git_not_found" + // These "hasProperty"'s are so that they can be passed through the cli (ie in the CI) try { -// "git rev-parse --is-inside-work-tree".execute() // If git doesnt exist, or this isnt cloned from git, then this wont work - if (gitMainCommit != "null") - git_main_commit = gitMainCommit - else - git_main_commit = 'git rev-parse --verify HEAD'.execute().text.trim() - - if (gitCoreCommit != "null") - git_core_commit = gitCoreCommit - else - git_core_commit = 'git ls-tree --object-only HEAD ../coreSubProjects'.execute().text.trim() // TODO: is there a way to do this universally - - if (gitMainBranch != "null") - git_main_branch = gitMainBranch - else - git_main_branch = 'git symbolic-ref --short HEAD'.execute().text.trim() + if (infoGitCommit == "null") + infoGitCommit = 'git rev-parse --verify HEAD'.execute().text.trim() + if (infoGitBranch == "null") + infoGitBranch = 'git symbolic-ref --short HEAD'.execute().text.trim() } catch (Exception e) { + infoGitCommit = infoGitBranch = "Git not found" println "Git or Git project not found" } @@ -400,9 +387,9 @@ subprojects { p -> java_version : java_version, quilt_contributors : "{"+quilt_contributors.join(", ")+"}", - git_main_commit : git_main_commit, - git_core_commit : git_core_commit, - git_main_branch : git_main_branch, + info_git_commit : infoGitBranch, + info_git_branch : infoGitCommit, + info_build_source : infoBuildSource, fabric_incompatibility_list : fabric_incompatibility_list, fabric_recommend_list : fabric_recommend_list, diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java index 608592901..7d2b8f1d0 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java @@ -1,12 +1,10 @@ package com.seibel.distanthorizons.common.wrappers.gui.updater; import com.mojang.blaze3d.platform.NativeImage; -import com.mojang.blaze3d.vertex.PoseStack; import com.seibel.distanthorizons.api.enums.config.EUpdateBranch; import com.seibel.distanthorizons.common.wrappers.gui.DhScreen; import com.seibel.distanthorizons.common.wrappers.gui.TexturedButtonWidget; -import com.seibel.distanthorizons.core.jar.ModGitInfo; -import com.seibel.distanthorizons.core.jar.installer.GitlabGetter; +import com.seibel.distanthorizons.core.jar.ModJarInfo; import com.seibel.distanthorizons.coreapi.ModInfo; import com.seibel.distanthorizons.core.config.Config; import com.seibel.distanthorizons.core.jar.JarUtils; @@ -16,7 +14,6 @@ import net.minecraft.client.Minecraft; #if POST_MC_1_20_1 import net.minecraft.client.gui.GuiGraphics; #endif -import net.minecraft.client.gui.components.ImageButton; import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.renderer.texture.DynamicTexture; import net.minecraft.resources.ResourceLocation; @@ -53,7 +50,7 @@ public class UpdateModScreen extends DhScreen nextVer = ModrinthGetter.releaseNames.get(this.newVersionID); break; case NIGHTLY: - currentVer = ModGitInfo.Git_Main_Commit.substring(0,7); + currentVer = ModJarInfo.Git_Commit.substring(0,7); nextVer = this.newVersionID.substring(0,7); break; } diff --git a/common/src/main/resources/build_info.json b/common/src/main/resources/build_info.json index 1dda317d6..d0077133d 100644 --- a/common/src/main/resources/build_info.json +++ b/common/src/main/resources/build_info.json @@ -1,5 +1,5 @@ { - "git_main_branch": "${git_main_branch}", - "git_main_commit": "${git_main_commit}", - "git_core_commit": "${git_core_commit}" + "info_git_commit": "${info_git_commit}", + "info_git_branch": "${info_git_branch}", + "info_build_source": "${info_build_source}" } \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle index 84c5e42ac..d3de3384b 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -127,7 +127,7 @@ processResources { runClient { dependsOn(copyCoreResources) dependsOn(copyCommonLoaderResources) - jvmArgs([ "-XX:-OmitStackTraceInFastThrow", minecraftMemoryJavaArg ]) +// jvmArgs([ "-XX:-OmitStackTraceInFastThrow", minecraftMemoryJavaArg ]) finalizedBy(deleteResources) } diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java index af0e28236..0108da4b3 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java @@ -22,7 +22,7 @@ package com.seibel.distanthorizons.fabric; import com.seibel.distanthorizons.api.methods.events.abstractEvents.DhApiAfterDhInitEvent; import com.seibel.distanthorizons.api.methods.events.abstractEvents.DhApiBeforeDhInitEvent; import com.seibel.distanthorizons.core.config.ConfigBase; -import com.seibel.distanthorizons.core.jar.ModGitInfo; +import com.seibel.distanthorizons.core.jar.ModJarInfo; import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.*; import com.seibel.distanthorizons.common.LodCommonMain; @@ -80,9 +80,9 @@ public class FabricMain LOGGER.info(ModInfo.READABLE_NAME + ", Version: " + ModInfo.VERSION); // Print git info (Useful for dev builds) - LOGGER.info("DH Branch: " + ModGitInfo.Git_Main_Branch); - LOGGER.info("DH Commit: " + ModGitInfo.Git_Main_Commit); - LOGGER.info("DH-Core Commit: " + ModGitInfo.Git_Core_Commit); + LOGGER.info("DH Branch: " + ModJarInfo.Git_Branch); + LOGGER.info("DH Commit: " + ModJarInfo.Git_Commit); + LOGGER.info("DH Jar Build Source: " + ModJarInfo.Build_Source); IModChecker modChecker = SingletonInjector.INSTANCE.get(IModChecker.class); if (modChecker.isModLoaded("sodium")) diff --git a/forge/build.gradle b/forge/build.gradle index 2a2753f91..4d3d395f7 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -36,7 +36,7 @@ loom { setConfigName("Forge Client") ideConfigGenerated(true) runDir("../run") - vmArgs("-XX:-OmitStackTraceInFastThrow", minecraftMemoryJavaArg) +// vmArgs("-XX:-OmitStackTraceInFastThrow", minecraftMemoryJavaArg) } server { server() diff --git a/forge/src/main/java/com/seibel/distanthorizons/forge/ForgeMain.java b/forge/src/main/java/com/seibel/distanthorizons/forge/ForgeMain.java index 94d6981ee..6ee80e4de 100644 --- a/forge/src/main/java/com/seibel/distanthorizons/forge/ForgeMain.java +++ b/forge/src/main/java/com/seibel/distanthorizons/forge/ForgeMain.java @@ -26,7 +26,7 @@ import com.seibel.distanthorizons.common.forge.LodForgeMethodCaller; import com.seibel.distanthorizons.common.wrappers.DependencySetup; import com.seibel.distanthorizons.common.wrappers.gui.GetConfigScreen; import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftClientWrapper; -import com.seibel.distanthorizons.core.jar.ModGitInfo; +import com.seibel.distanthorizons.core.jar.ModJarInfo; import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.AbstractOptifineAccessor; import com.seibel.distanthorizons.coreapi.DependencyInjection.ApiEventInjector; import com.seibel.distanthorizons.coreapi.ModInfo; @@ -69,7 +69,6 @@ import net.minecraftforge.client.model.data.ModelDataMap; import java.util.Random; #else -import net.minecraft.util.RandomSource; import net.minecraft.client.renderer.RenderType; import net.minecraftforge.client.model.data.ModelData; #endif @@ -115,9 +114,9 @@ public class ForgeMain implements LodForgeMethodCaller LOGGER.info(ModInfo.READABLE_NAME + ", Version: " + ModInfo.VERSION); // Print git info (Useful for dev builds) - LOGGER.info("DH Branch: " + ModGitInfo.Git_Main_Branch); - LOGGER.info("DH Commit: " + ModGitInfo.Git_Main_Commit); - LOGGER.info("DH-Core Commit: " + ModGitInfo.Git_Core_Commit); + LOGGER.info("DH Branch: " + ModJarInfo.Git_Branch); + LOGGER.info("DH Commit: " + ModJarInfo.Git_Commit); + LOGGER.info("DH Jar Build Source: " + ModJarInfo.Build_Source); client_proxy = new ForgeClientProxy(); MinecraftForge.EVENT_BUS.register(client_proxy); diff --git a/gradle.properties b/gradle.properties index 811ba8146..fb5739efc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -35,9 +35,9 @@ joml_version=1.10.2 # These are here so they can be changed with cmd arguments # If they are null, they would be automatically set # (This is mainly used for the CI) -gitMainCommit=null -gitCoreCommit=null -gitMainBranch=null +infoGitCommit=null +infoGitBranch=null +infoBuildSource=User # Internal Properties (These are set at runtime for Forgix to merge jar's) versionStr=