diff --git a/Paper-MojangAPI/build.gradle.kts b/Paper-MojangAPI/build.gradle.kts index 536b4577c..0fdb8a028 100644 --- a/Paper-MojangAPI/build.gradle.kts +++ b/Paper-MojangAPI/build.gradle.kts @@ -1,5 +1,6 @@ plugins { `java-library` + `maven-publish` } java { @@ -23,3 +24,9 @@ dependencies { testImplementation("org.hamcrest:hamcrest-library:1.3") testImplementation("org.ow2.asm:asm-tree:7.3.1") } + +configure { + publications.create("maven") { + from(components["java"]) + } +} diff --git a/patches/api/0001-Convert-project-to-Gradle.patch b/patches/api/0001-Convert-project-to-Gradle.patch index 64567fb6d..c152ea314 100644 --- a/patches/api/0001-Convert-project-to-Gradle.patch +++ b/patches/api/0001-Convert-project-to-Gradle.patch @@ -16,14 +16,15 @@ index e431e3435737e28394d81b56568a08b3c3148b9b..c484aff2c192bf42059b5689327909e4 /.project diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 -index 0000000000000000000000000000000000000000..35b57f52fcfd91cff04dc60c3a8a16b31f775fc0 +index 0000000000000000000000000000000000000000..271a6672e7fe9ce51bf96c8c18f5579fc47b2414 --- /dev/null +++ b/build.gradle.kts -@@ -0,0 +1,59 @@ +@@ -0,0 +1,66 @@ +import java.util.Locale + +plugins { + `java-library` ++ `maven-publish` +} + +java { @@ -52,6 +53,12 @@ index 0000000000000000000000000000000000000000..35b57f52fcfd91cff04dc60c3a8a16b3 + testImplementation("org.ow2.asm:asm-tree:9.1") +} + ++configure { ++ publications.create("maven") { ++ from(components["java"]) ++ } ++} ++ +val generateApiVersioningFile by tasks.registering { + val pomProps = layout.buildDirectory.file("pom.properties") + outputs.file(pomProps) diff --git a/patches/api/0002-Build-system-changes.patch b/patches/api/0002-Build-system-changes.patch index 012a45883..3ca987e84 100644 --- a/patches/api/0002-Build-system-changes.patch +++ b/patches/api/0002-Build-system-changes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Build system changes diff --git a/build.gradle.kts b/build.gradle.kts -index 35b57f52fcfd91cff04dc60c3a8a16b31f775fc0..328fe3d7708b0e93dad080c7689d0d7cde138288 100644 +index 271a6672e7fe9ce51bf96c8c18f5579fc47b2414..125fee17f7ab37fb2b4deb096f37a43cb9519e96 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -16,12 +16,14 @@ dependencies { +@@ -17,12 +17,14 @@ dependencies { api("com.google.code.gson:gson:2.8.0") api("net.md-5:bungeecord-chat:1.16-R0.4") api("org.yaml:snakeyaml:1.29") diff --git a/patches/api/0003-Add-FastUtil-to-Bukkit.patch b/patches/api/0003-Add-FastUtil-to-Bukkit.patch index a315769d1..c5c0470aa 100644 --- a/patches/api/0003-Add-FastUtil-to-Bukkit.patch +++ b/patches/api/0003-Add-FastUtil-to-Bukkit.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add FastUtil to Bukkit Doesn't expose to plugins, just allows Paper-API to use it for optimization diff --git a/build.gradle.kts b/build.gradle.kts -index 20c8a34b299ba455c29b4e31d311de0b3a063288..6243c2fc2021e6c4fe0f036892bc83983364f360 100644 +index 125fee17f7ab37fb2b4deb096f37a43cb9519e96..e4123d5f918a5f21b7f6fddba7084643f86ad5aa 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -17,6 +17,7 @@ dependencies { +@@ -18,6 +18,7 @@ dependencies { api("net.md-5:bungeecord-chat:1.16-R0.4") api("org.yaml:snakeyaml:1.29") api("com.googlecode.json-simple:json-simple:1.1.1") // Paper diff --git a/patches/api/0006-Adventure.patch b/patches/api/0006-Adventure.patch index ca041f6d3..5d255c4fc 100644 --- a/patches/api/0006-Adventure.patch +++ b/patches/api/0006-Adventure.patch @@ -7,10 +7,10 @@ Co-authored-by: zml Co-authored-by: Jake Potrebic diff --git a/build.gradle.kts b/build.gradle.kts -index 6243c2fc2021e6c4fe0f036892bc83983364f360..d22f6ce80583f4a12e61b5ca89033deeeebde5d5 100644 +index e4123d5f918a5f21b7f6fddba7084643f86ad5aa..176180570bf2705d975cf349faf08b5ba32cdab3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -18,6 +18,11 @@ dependencies { +@@ -19,6 +19,11 @@ dependencies { api("org.yaml:snakeyaml:1.29") api("com.googlecode.json-simple:json-simple:1.1.1") // Paper api("it.unimi.dsi:fastutil:8.2.2") diff --git a/patches/api/0024-Use-ASM-for-event-executors.patch b/patches/api/0024-Use-ASM-for-event-executors.patch index ba94a254e..303673fd3 100644 --- a/patches/api/0024-Use-ASM-for-event-executors.patch +++ b/patches/api/0024-Use-ASM-for-event-executors.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Use ASM for event executors. Uses method handles for private or static methods. diff --git a/build.gradle.kts b/build.gradle.kts -index d22f6ce80583f4a12e61b5ca89033deeeebde5d5..a5f7258a543c8a9e2ce55c6f8f1b6f3435ef608e 100644 +index 176180570bf2705d975cf349faf08b5ba32cdab3..c10c9f86db276b42d8b7c21c353970691990f125 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -23,6 +23,8 @@ dependencies { +@@ -24,6 +24,8 @@ dependencies { api("net.kyori:adventure-text-serializer-gson") api("net.kyori:adventure-text-serializer-legacy") api("net.kyori:adventure-text-serializer-plain") diff --git a/patches/api/0067-Allow-plugins-to-use-SLF4J-for-logging.patch b/patches/api/0067-Allow-plugins-to-use-SLF4J-for-logging.patch index 219688483..0ee190ea3 100644 --- a/patches/api/0067-Allow-plugins-to-use-SLF4J-for-logging.patch +++ b/patches/api/0067-Allow-plugins-to-use-SLF4J-for-logging.patch @@ -14,10 +14,10 @@ it without having to shade it in the plugin and going through several layers of logging abstraction. diff --git a/build.gradle.kts b/build.gradle.kts -index a5f7258a543c8a9e2ce55c6f8f1b6f3435ef608e..12c4f278d52bd6fb626fc7cd9414e8869c49fcd2 100644 +index c10c9f86db276b42d8b7c21c353970691990f125..6d04816e22f44a33c001d2b7e080402fba6af86c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -25,6 +25,7 @@ dependencies { +@@ -26,6 +26,7 @@ dependencies { api("net.kyori:adventure-text-serializer-plain") api("org.ow2.asm:asm:9.0") api("org.ow2.asm:asm-commons:9.0") diff --git a/patches/server/0001-Setup-Gradle-project.patch b/patches/server/0001-Setup-Gradle-project.patch index b2c3b3a0e..8672be8dd 100644 --- a/patches/server/0001-Setup-Gradle-project.patch +++ b/patches/server/0001-Setup-Gradle-project.patch @@ -17,11 +17,10 @@ index 67fb370cad6924895a6b27052dbd5c1767e3f0c9..3e05459f27c4c5697ae65da504d67a6a /.project diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 -index 0000000000000000000000000000000000000000..21b97f37a4c4d35d80bc1c1b98f55bcfb8d21f20 +index 0000000000000000000000000000000000000000..80fab4621582aed02cc029900999ceff72e027ef --- /dev/null +++ b/build.gradle.kts -@@ -0,0 +1,121 @@ -+import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer +@@ -0,0 +1,131 @@ +import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer +import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer +import io.papermc.paperweight.util.Git @@ -33,6 +32,7 @@ index 0000000000000000000000000000000000000000..21b97f37a4c4d35d80bc1c1b98f55bcf + +plugins { + java ++ `maven-publish` + id("com.github.johnrengelman.shadow") +} + @@ -86,6 +86,16 @@ index 0000000000000000000000000000000000000000..21b97f37a4c4d35d80bc1c1b98f55bcf + } +} + ++configure { ++ publications.create("maven") { ++ // todo: confirm this is correct ++ from(components["java"]) ++ artifact(tasks.reobfJar) { ++ classifier = "reobf" ++ } ++ } ++} ++ +tasks.shadowJar { + listOf( + "jline", "it.unimi", "org.apache.commons.codec", "org.apache.commons.io", diff --git a/patches/server/0003-Build-system-changes.patch b/patches/server/0003-Build-system-changes.patch index 29cd18e97..37c7c0d01 100644 --- a/patches/server/0003-Build-system-changes.patch +++ b/patches/server/0003-Build-system-changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Build system changes diff --git a/build.gradle.kts b/build.gradle.kts -index ccb67fe90e25010f7c8ca168d60d096ef95c4429..f353524ada2caa05824b1e7ded17a1c00473d906 100644 +index 80fab4621582aed02cc029900999ceff72e027ef..07be9eb1dd7f0f85e8a36cc4e8df807bae989372 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,21 +22,24 @@ repositories { @@ -47,9 +47,19 @@ index ccb67fe90e25010f7c8ca168d60d096ef95c4429..f353524ada2caa05824b1e7ded17a1c0 )) for (tld in listOf("net", "com", "org")) { attributes(mapOf( -@@ -65,7 +69,7 @@ tasks.jar { +@@ -73,9 +77,17 @@ configure { + } + } ++val generatePom = tasks.named("generatePomFileForMavenPublication") ++ tasks.shadowJar { ++ // Needed for Paperclip's install to maven local feature ++ from(generatePom) { ++ into("META-INF/maven/io.papermc.paper/paper") ++ rename { "pom.xml" } ++ } ++ listOf( - "jline", "it.unimi", "org.apache.commons.codec", "org.apache.commons.io", + "jline", "org.apache.commons.codec", "org.apache.commons.io", // Paper - don't relocate fastutil