Fix CB lib relocation (#6454)

This commit is contained in:
Jake Potrebic 2021-08-22 10:22:57 -07:00 committed by GitHub
parent b37fbbca3d
commit 98fa136099
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 12 deletions

View file

@ -28,10 +28,10 @@ index 67fb370cad6924895a6b27052dbd5c1767e3f0c9..bb338269c9e3bef4c274157c490d8b8f
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000000000000000000000000000000000000..71f781083f2f81d064605b2a652181f22b98733d
index 0000000000000000000000000000000000000000..6f084d7500d9de76604440bdcc582be1af04fc8c
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,172 @@
@@ -0,0 +1,173 @@
+import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
+import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer
+import io.papermc.paperweight.util.Git
@ -105,6 +105,12 @@ index 0000000000000000000000000000000000000000..71f781083f2f81d064605b2a652181f2
+}
+
+relocation {
+ // Order matters here - e.g. craftbukkit proper must be relocated before any of the libs are relocated into the cb package
+ val packageVersion = "1_17_R1"
+ relocate("org.bukkit.craftbukkit" to "org.bukkit.craftbukkit.v$packageVersion") {
+ exclude("org.bukkit.craftbukkit.Main*")
+ }
+
+ fun cb(pack: String) = "org.bukkit.craftbukkit.libs.$pack"
+
+ sequenceOf(
@ -129,11 +135,6 @@ index 0000000000000000000000000000000000000000..71f781083f2f81d064605b2a652181f2
+ ).forEach { pack ->
+ relocate(pack to cb(pack))
+ }
+
+ val packageVersion = "1_17_R1"
+ relocate("org.bukkit.craftbukkit" to "org.bukkit.craftbukkit.v$packageVersion") {
+ exclude("org.bukkit.craftbukkit.Main*")
+ }
+}
+
+tasks.shadowJar {