diff --git a/worldedit-bukkit/build.gradle.kts b/worldedit-bukkit/build.gradle.kts index f92621967..9cfc36570 100644 --- a/worldedit-bukkit/build.gradle.kts +++ b/worldedit-bukkit/build.gradle.kts @@ -60,7 +60,15 @@ val adapters = configurations.create("adapters") { ) } } - +val foliaAdapters = configurations.create("foliaAdapters") { + description = "Adapters to include in the JAR" + isCanBeConsumed = false + isCanBeResolved = true + shouldResolveConsistentlyWith(configurations["runtimeClasspath"]) + attributes { + attribute(Obfuscation.OBFUSCATION_ATTRIBUTE, objects.named(Obfuscation.OBFUSCATED)) + } +} dependencies { // Modules api(projects.worldeditCore) @@ -70,7 +78,7 @@ dependencies { "adapters"(project(it.path)) } project.project(":worldedit-bukkit:folia-adapters").subprojects.forEach { - "adapters"(project(it.path)) + "foliaAdapters"(project(it.path)) } // Minecraft expectations @@ -154,6 +162,14 @@ tasks.named("shadowJar") { } } }) + from(Callable { + foliaAdapters.resolve() + .map { f -> + zipTree(f).matching { + exclude("META-INF/") + } + } + }) archiveFileName.set("${rootProject.name}-Bukkit-${project.version}.${archiveExtension.getOrElse("jar")}") dependencies { // In tandem with not bundling log4j, we shouldn't relocate base package here.