From 672c5365f422f2b9247b0fa5edc887352f512046 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sat, 12 Jun 2021 18:28:41 -0700 Subject: [PATCH] Write API version to pom.properties for Versioning to read Maven writes this metadata normally, but we don't use maven. Maybe should modify Versioning instead in the future, but this works just fine for now. --- gradle.properties | 2 +- .../api/0001-Convert-project-to-Gradle.patch | 17 +++++++++++++++-- patches/api/0002-POM-changes.patch | 4 ++-- patches/api/0003-Add-FastUtil-to-Bukkit.patch | 4 ++-- patches/api/0006-Adventure.patch | 4 ++-- .../api/0024-Use-ASM-for-event-executors.patch | 4 ++-- ...Allow-plugins-to-use-SLF4J-for-logging.patch | 4 ++-- 7 files changed, 26 insertions(+), 13 deletions(-) diff --git a/gradle.properties b/gradle.properties index 31b3057617..071cb6fb13 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -group = "io.papermc.paper" +group = io.papermc.paper version = 1.17-R0.1-SNAPSHOT mcVersion = 1.17 diff --git a/patches/api/0001-Convert-project-to-Gradle.patch b/patches/api/0001-Convert-project-to-Gradle.patch index d34ab3ef3c..1fb1db17ac 100644 --- a/patches/api/0001-Convert-project-to-Gradle.patch +++ b/patches/api/0001-Convert-project-to-Gradle.patch @@ -16,10 +16,12 @@ index e431e3435737e28394d81b56568a08b3c3148b9b..c484aff2c192bf42059b5689327909e4 /.project diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 -index 0000000000000000000000000000000000000000..a0f1c1d1ac63fdcce942922ffe68a8d44c712513 +index 0000000000000000000000000000000000000000..f3dd92e136a71aa39e422de7b2c5f2f3fdec554e --- /dev/null +++ b/build.gradle.kts -@@ -0,0 +1,54 @@ +@@ -0,0 +1,67 @@ ++import java.util.Locale ++ +plugins { + `java-library` + checkstyle @@ -53,7 +55,18 @@ index 0000000000000000000000000000000000000000..a0f1c1d1ac63fdcce942922ffe68a8d4 + checkstyle("com.puppycrawl.tools:checkstyle:8.39") +} + ++val generateApiVersioningFile by tasks.registering { ++ val pomProps = layout.buildDirectory.file("pom.properties") ++ outputs.file(pomProps) ++ doLast { ++ pomProps.get().asFile.writeText("version=${project.version}") ++ } ++} ++ +tasks.jar { ++ from(generateApiVersioningFile.map { it.outputs.files.singleFile }) { ++ into("META-INF/maven/${project.group}/${project.name.toLowerCase(Locale.ENGLISH)}") ++ } + manifest { + attributes += mapOf( + "Automatic-Module-Name" to "org.bukkit" diff --git a/patches/api/0002-POM-changes.patch b/patches/api/0002-POM-changes.patch index 274e996a2c..1422974313 100644 --- a/patches/api/0002-POM-changes.patch +++ b/patches/api/0002-POM-changes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] POM changes diff --git a/build.gradle.kts b/build.gradle.kts -index a0f1c1d1ac63fdcce942922ffe68a8d44c712513..fd47081fbc8cc5d88a57689d1beee5eddc78f845 100644 +index f3dd92e136a71aa39e422de7b2c5f2f3fdec554e..b75ac1f11c3171a3f0c8edb30be3555216f51b0a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -15,10 +15,12 @@ dependencies { +@@ -17,10 +17,12 @@ 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 5ce84dd993..8e8ee65d9e 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 fd47081fbc8cc5d88a57689d1beee5eddc78f845..95327c3971cd57e01da2a62e1b72ba15fcbb63f4 100644 +index b75ac1f11c3171a3f0c8edb30be3555216f51b0a..218e9c682e7b91dc27f2caf46316ba7a7982e5f3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -16,6 +16,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 002a345853..1037cf46f7 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 95327c3971cd57e01da2a62e1b72ba15fcbb63f4..4c197e7d9966f8789e6709461e59fc89355afd9c 100644 +index 218e9c682e7b91dc27f2caf46316ba7a7982e5f3..50c3a01826f0ff939e3ee935d5a4e446f46c8cce 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -17,6 +17,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 6c76c6b4f0..2cb4f1f832 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 4c197e7d9966f8789e6709461e59fc89355afd9c..9451f8660ec248619383d516df4b95e20e24828a 100644 +index 50c3a01826f0ff939e3ee935d5a4e446f46c8cce..c976d4458886603feeb05b7c854a5c1e54fcb287 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -22,6 +22,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 0555a52329..b59af7a1bd 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 9451f8660ec248619383d516df4b95e20e24828a..9657dcb900267cb5cd1ad7a850eb15bc74479314 100644 +index c976d4458886603feeb05b7c854a5c1e54fcb287..9633529a71556a453edae71b09a573a957d65c60 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -24,6 +24,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")