Downgrade Via dependencies to J8

This commit is contained in:
FlorianMichael 2024-06-04 01:33:43 +02:00
parent d7f7fa0bce
commit eb7c177f3a
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
3 changed files with 24 additions and 9 deletions

View File

@ -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

View File

@ -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<version>/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)

View File

@ -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