From eb7c177f3aaf0c151f372113f5f87694a11b611c Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Tue, 4 Jun 2024 01:33:43 +0200 Subject: [PATCH] Downgrade Via dependencies to J8 --- .github/workflows/main.yml | 4 ++-- README.md | 8 ++++++++ build.gradle | 21 ++++++++++++++------- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7cc7501..c6656bb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,10 +9,10 @@ jobs: uses: actions/checkout@v4 - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v1 - - name: Set up JDK 16 + - name: Set up JDK 8 uses: actions/setup-java@v3 with: - java-version: 16 + java-version: 8 distribution: 'temurin' check-latest: true - name: Cache Dependencies diff --git a/README.md b/README.md index 727751b..39a4bad 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,14 @@ Since ForgeGradle for Minecraft 1.8.9 is too old, it has its own branch called ` ### I want ViaForge in my own utility mod Just take a look at my other Project called `ViaMCP`: https://github.com/FlorianMichael/ViaMCP +## For developers +### How to build +1. Clone the repository with `git clone`. +2. Run `./gradlew build` in the root directory of the repository. +3. The compiled jar files can be found in `viaforge-mc/build/libs`. + +Note: Build scripts are made to be run using Java 8. + ## Other ViaVersion Mods / Platforms - ViaFabric - https://modrinth.com/mod/viafabric - ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus (Includes additional modifications to make the experience better) diff --git a/build.gradle b/build.gradle index 7f3a3b7..8cb42d8 100644 --- a/build.gradle +++ b/build.gradle @@ -12,6 +12,7 @@ buildscript { classpath "net.minecraftforge.gradle:ForgeGradle:6.+" classpath "org.spongepowered:mixingradle:0.7-SNAPSHOT" classpath "me.modmuss50:mod-publish-plugin:0.5.1" + classpath "xyz.wagyourtail.jvmdowngrader:gradle-plugin:0.6.1" } } @@ -19,14 +20,20 @@ allprojects { apply plugin: "java-library" apply plugin: "com.github.johnrengelman.shadow" apply plugin: "me.modmuss50.mod-publish-plugin" + apply plugin: "xyz.wagyourtail.jvmdowngrader" // We define the configuration here so we can use it across all conventions and platforms // To define which projects/source files should be included in the jar configurations { library implementation.extendsFrom(library) + + libraryJ8 + library.extendsFrom(libraryJ8) } + jvmdg.dg(configurations.libraryJ8) + // Repositories for the ViaVersion dependencies defined below repositories { maven { @@ -53,14 +60,14 @@ allprojects { dependencies { compileOnly "io.netty:netty-all:4.0.20.Final" - library "com.viaversion:viaversion-common:${project.viaversion_version}" - library "com.viaversion:viabackwards-common:${project.viabackwards_version}" - library "com.viaversion:viarewind-common:${project.viarewind_version}" - library ("net.raphimc:ViaLegacy:${project.vialegacy_version}") { + libraryJ8 "com.viaversion:viaversion-common:${project.viaversion_version}" + libraryJ8 "com.viaversion:viabackwards-common:${project.viabackwards_version}" + libraryJ8 "com.viaversion:viarewind-common:${project.viarewind_version}" + libraryJ8 ("net.raphimc:ViaLegacy:${project.vialegacy_version}") { exclude group: "com.google.code.gson", module: "gson" } - library "net.raphimc:ViaAprilFools:${project.viaaprilfools_version}" - library ("net.raphimc:ViaLoader:${project.vialoader_version}") { + libraryJ8 "net.raphimc:ViaAprilFools:${project.viaaprilfools_version}" + libraryJ8 ("net.raphimc:ViaLoader:${project.vialoader_version}") { exclude group: "com.google.guava" exclude group: "org.slf4j" } @@ -157,7 +164,7 @@ subprojects { shadowJar { archiveFileName = jar.archiveFileName - configurations = [project.configurations.library] // Include the dependencies from the include configuration + configurations = [project.configurations.library, project.configurations.libraryJ8] // Include the dependencies from the include configuration duplicatesStrategy DuplicatesStrategy.EXCLUDE // Prevent conflicts with Forge's weird service loading