From 311d177ca779f33b6491b494fbc6b8a0428e89ac Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Sun, 30 Jun 2024 12:14:05 +0100 Subject: [PATCH] Shade updated MVEL2 for JAS Closes #38 - for real this time --- build.gradle.kts | 7 +++++++ dependencies.gradle | 2 ++ 2 files changed, 9 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 408b4d7..ae752e4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,6 +2,7 @@ import com.gtnewhorizons.retrofuturagradle.minecraft.RunMinecraftTask import com.gtnewhorizons.retrofuturagradle.util.Distribution import com.modrinth.minotaur.ModrinthExtension import org.apache.tools.ant.filters.ReplaceTokens +import java.nio.charset.StandardCharsets import java.time.OffsetDateTime import java.time.ZoneOffset import java.time.format.DateTimeFormatter @@ -138,8 +139,14 @@ val forgePatchesJar = tasks.register("forgePatchesJar") { filesMatching("META-INF/*") { this.name = "${dep.name}-${this.name}" } + filesMatching("META-INF/services/javax.script.ScriptEngineFactory") { + this.exclude() + } } } + from(resources.text.fromString("org.openjdk.nashorn.api.scripting.NashornScriptEngineFactory\norg.mvel2.jsr223.MvelScriptEngineFactory").asFile(StandardCharsets.UTF_8.name())) { + rename { return@rename "META-INF/services/javax.script.ScriptEngineFactory" } + } exclude("module-info.class") exclude("META-INF/versions/9/module-info.class") exclude("log4j2.xml") diff --git a/dependencies.gradle b/dependencies.gradle index 0996049..7edde17 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -43,6 +43,8 @@ dependencies { forgePatchesEmbedded("org.apache.commons:commons-lang3:3.14.0") forgePatchesEmbedded("org.apache.commons:commons-compress:1.26.2") forgePatchesEmbedded("commons-io:commons-io:2.15.1") + // For Just Another Spawner + forgePatchesEmbedded("org.mvel:mvel2:2.5.2.Final") compileOnly("org.jetbrains:annotations:24.1.0")