From 8f4269a3028d0bb779a8e98d275412835d09e786 Mon Sep 17 00:00:00 2001 From: Octavia Togami Date: Tue, 24 Oct 2023 22:16:28 -0700 Subject: [PATCH 1/2] Use the adapters config to drive dependencies This is literally the obvious way to do it, idk what I was doing --- worldedit-bukkit/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-bukkit/build.gradle.kts b/worldedit-bukkit/build.gradle.kts index 5dbc7d1489..777532947c 100644 --- a/worldedit-bukkit/build.gradle.kts +++ b/worldedit-bukkit/build.gradle.kts @@ -78,7 +78,7 @@ tasks.named("processResources") { addJarManifest(WorldEditKind.Plugin, includeClasspath = true) tasks.named("shadowJar") { - dependsOn(project.project(":worldedit-bukkit:adapters").subprojects.map { it.tasks.named("assemble") }) + dependsOn(adapters) from(Callable { adapters.resolve() .map { f -> From 0e9427512252b5253522821bd4373ea57d81fd40 Mon Sep 17 00:00:00 2001 From: Octavia Togami Date: Tue, 24 Oct 2023 23:46:39 -0700 Subject: [PATCH 2/2] Properly shade adapters Causes a bunch of problems and I want to delete shadow --- worldedit-bukkit/build.gradle.kts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/worldedit-bukkit/build.gradle.kts b/worldedit-bukkit/build.gradle.kts index 777532947c..9f8a9dc15a 100644 --- a/worldedit-bukkit/build.gradle.kts +++ b/worldedit-bukkit/build.gradle.kts @@ -78,15 +78,7 @@ tasks.named("processResources") { addJarManifest(WorldEditKind.Plugin, includeClasspath = true) tasks.named("shadowJar") { - dependsOn(adapters) - from(Callable { - adapters.resolve() - .map { f -> - zipTree(f).matching { - exclude("META-INF/") - } - } - }) + configurations.add(adapters) dependencies { // In tandem with not bundling log4j, we shouldn't relocate base package here. // relocate("org.apache.logging", "com.sk89q.worldedit.log4j") @@ -100,11 +92,21 @@ tasks.named("shadowJar") { include(dependency("it.unimi.dsi:fastutil")) include(dependency("com.sk89q.lib:jlibnoise")) + exclude(dependency("$group:$name")) + relocate("org.bstats", "com.sk89q.worldedit.bstats") relocate("io.papermc.lib", "com.sk89q.worldedit.bukkit.paperlib") relocate("it.unimi.dsi.fastutil", "com.sk89q.worldedit.bukkit.fastutil") relocate("net.royawesome.jlibnoise", "com.sk89q.worldedit.jlibnoise") } + project.project(":worldedit-bukkit:adapters").subprojects.forEach { + dependencies { + include(dependency("${it.group}:${it.name}")) + } + minimize { + exclude(dependency("${it.group}:${it.name}")) + } + } } tasks.named("assemble").configure {