From ba643073079d34e0adc46ac9f8fa52d416d106e7 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Tue, 20 Jul 2021 00:58:48 +0200 Subject: [PATCH] Don't expose ASM in API (#6229) ASM was not meant to exposed to API consumers in the first place, and for the duration of time it has been exposed, it has also been relocated. Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> --- patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch | 8 ++++---- patches/api/Use-ASM-for-event-executors.patch | 7 ++++--- patches/server/Build-system-changes.patch | 1 + ...fuscate-stacktraces-in-log-messages-crash-report.patch | 4 ++-- patches/server/Setup-Gradle-project.patch | 2 -- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch b/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch index 5c6707829..b04cff9a4 100644 --- a/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch +++ b/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch @@ -18,13 +18,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -0,0 +0,0 @@ dependencies { + api("net.kyori:adventure-text-serializer-gson") + api("net.kyori:adventure-text-serializer-legacy") api("net.kyori:adventure-text-serializer-plain") - api("org.ow2.asm:asm:9.0") - api("org.ow2.asm:asm-commons:9.0") + api("org.apache.logging.log4j:log4j-api:2.14.1") // Paper - compileOnly("org.apache.maven:maven-resolver-provider:3.8.1") - compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0") + implementation("org.ow2.asm:asm:9.1") + implementation("org.ow2.asm:asm-commons:9.1") diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/plugin/Plugin.java diff --git a/patches/api/Use-ASM-for-event-executors.patch b/patches/api/Use-ASM-for-event-executors.patch index e5e3fdfac..a0f1a34aa 100644 --- a/patches/api/Use-ASM-for-event-executors.patch +++ b/patches/api/Use-ASM-for-event-executors.patch @@ -10,14 +10,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -0,0 +0,0 @@ dependencies { - api("net.kyori:adventure-text-serializer-gson") api("net.kyori:adventure-text-serializer-legacy") api("net.kyori:adventure-text-serializer-plain") -+ api("org.ow2.asm:asm:9.0") -+ api("org.ow2.asm:asm-commons:9.0") ++ implementation("org.ow2.asm:asm:9.1") ++ implementation("org.ow2.asm:asm-commons:9.1") ++ compileOnly("org.apache.maven:maven-resolver-provider:3.8.1") compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0") + compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.0") diff --git a/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 diff --git a/patches/server/Build-system-changes.patch b/patches/server/Build-system-changes.patch index 999883bf7..2c560ba20 100644 --- a/patches/server/Build-system-changes.patch +++ b/patches/server/Build-system-changes.patch @@ -18,6 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") // Paper + implementation("org.apache.logging.log4j:log4j-api:2.14.1") // Paper implementation("org.ow2.asm:asm:9.1") ++ implementation("org.ow2.asm:asm-commons:9.1") // Paper - ASM event executor generation implementation("com.googlecode.json-simple:json-simple:1.1.1") { // This includes junit transitively for whatever reason isTransitive = false diff --git a/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch index 60ea4dc7c..9c4fe9c3a 100644 --- a/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -19,9 +19,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import io.papermc.paperweight.util.path import shadow.org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.PLUGIN_CACHE_FILE +import java.nio.file.Files - import java.text.SimpleDateFormat - import java.util.Date import java.util.Locale + + plugins { @@ -0,0 +0,0 @@ plugins { repositories { diff --git a/patches/server/Setup-Gradle-project.patch b/patches/server/Setup-Gradle-project.patch index ae2be4b86..a4b268bd1 100644 --- a/patches/server/Setup-Gradle-project.patch +++ b/patches/server/Setup-Gradle-project.patch @@ -29,8 +29,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import io.papermc.paperweight.util.Git +import io.papermc.paperweight.util.path +import shadow.org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.PLUGIN_CACHE_FILE -+import java.text.SimpleDateFormat -+import java.util.Date +import java.util.Locale + +plugins {