From b944d36558aa7b7839cf70c58e0c7cff821d30e2 Mon Sep 17 00:00:00 2001 From: DJtheRedstoner <52044242+DJtheRedstoner@users.noreply.github.com> Date: Fri, 3 Sep 2021 10:13:20 -0400 Subject: [PATCH] relocate gson in forge-legacy to fix crash closes #1 --- build.gradle.kts | 1 + forge-legacy/build.gradle | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4597596..53d720b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,6 +2,7 @@ import org.gradle.jvm.tasks.Jar plugins { `java-library` + id("com.github.johnrengelman.shadow") version "7.0.0" apply false } allprojects { diff --git a/forge-legacy/build.gradle b/forge-legacy/build.gradle index f060751..c3bd34b 100644 --- a/forge-legacy/build.gradle +++ b/forge-legacy/build.gradle @@ -8,6 +8,7 @@ buildscript { } apply plugin: "net.minecraftforge.gradle" +apply plugin: "com.github.johnrengelman.shadow" configurations { include { transitive = false } @@ -31,14 +32,23 @@ dependencies { include project(":common") include "com.electronwill.night-config:core:3.6.4" include "com.electronwill.night-config:toml:3.6.4" + include "com.google.code.gson:gson:2.4" } -jar.finalizedBy("reobfJar") - jar { - from configurations.include.collect() { zipTree(it) } + enabled = false +} + +shadowJar { + archiveClassifier.set("") + + configurations = [project.configurations.include] manifest.attributes( "FMLCorePlugin": "me.djtheredstoner.devauth.forge.legacy.DevAuthLoadingPlugin" ) -} \ No newline at end of file + + relocate "com.google.gson", "me.djtheredstoner.devauth.gson" +} + +jar.dependsOn(shadowJar) \ No newline at end of file