From a26d1aa4276027c268b65b25d8fd2d0bbd62e493 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Wed, 16 Jun 2021 16:23:02 -0700 Subject: [PATCH] Fix artifact ids --- Paper-MojangAPI/build.gradle.kts | 3 ++ .../api/0001-Convert-project-to-Gradle.patch | 5 +-- .../server/0001-Setup-Gradle-project.patch | 32 ++++++++++--------- .../server/0003-Build-system-changes.patch | 22 ++++++------- ...oleAppender-for-console-improvements.patch | 4 +-- ...n-prefixes-using-Log4J-configuration.patch | 4 +-- ...225-Use-asynchronous-Log4j-2-loggers.patch | 4 +-- .../0426-Implement-Brigadier-Mojang-API.patch | 4 +-- .../server/0432-Implement-Mob-Goal-API.patch | 4 +-- ...pport-for-hex-color-codes-in-console.patch | 4 +-- 10 files changed, 46 insertions(+), 40 deletions(-) diff --git a/Paper-MojangAPI/build.gradle.kts b/Paper-MojangAPI/build.gradle.kts index 0fdb8a028..f7bf0ff77 100644 --- a/Paper-MojangAPI/build.gradle.kts +++ b/Paper-MojangAPI/build.gradle.kts @@ -1,3 +1,5 @@ +import java.util.Locale + plugins { `java-library` `maven-publish` @@ -27,6 +29,7 @@ dependencies { configure { publications.create("maven") { + artifactId = project.name.toLowerCase(Locale.ENGLISH) from(components["java"]) } } diff --git a/patches/api/0001-Convert-project-to-Gradle.patch b/patches/api/0001-Convert-project-to-Gradle.patch index c152ea314..447189fc5 100644 --- a/patches/api/0001-Convert-project-to-Gradle.patch +++ b/patches/api/0001-Convert-project-to-Gradle.patch @@ -16,10 +16,10 @@ index e431e3435737e28394d81b56568a08b3c3148b9b..c484aff2c192bf42059b5689327909e4 /.project diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 -index 0000000000000000000000000000000000000000..271a6672e7fe9ce51bf96c8c18f5579fc47b2414 +index 0000000000000000000000000000000000000000..b378772dce6fddf0a3f24e1c48667602fc356e51 --- /dev/null +++ b/build.gradle.kts -@@ -0,0 +1,66 @@ +@@ -0,0 +1,67 @@ +import java.util.Locale + +plugins { @@ -55,6 +55,7 @@ index 0000000000000000000000000000000000000000..271a6672e7fe9ce51bf96c8c18f5579f + +configure { + publications.create("maven") { ++ artifactId = project.name.toLowerCase(Locale.ENGLISH) + from(components["java"]) + } +} diff --git a/patches/server/0001-Setup-Gradle-project.patch b/patches/server/0001-Setup-Gradle-project.patch index 2159f800c..f0e88eb22 100644 --- a/patches/server/0001-Setup-Gradle-project.patch +++ b/patches/server/0001-Setup-Gradle-project.patch @@ -17,10 +17,10 @@ index 67fb370cad6924895a6b27052dbd5c1767e3f0c9..3e05459f27c4c5697ae65da504d67a6a /.project diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 -index 0000000000000000000000000000000000000000..792fea417637493814071850e780e9923d75a637 +index 0000000000000000000000000000000000000000..84af6353d060c65d5f125559becc011aeba8a842 --- /dev/null +++ b/build.gradle.kts -@@ -0,0 +1,132 @@ +@@ -0,0 +1,134 @@ +import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer +import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer +import io.papermc.paperweight.util.Git @@ -28,6 +28,7 @@ index 0000000000000000000000000000000000000000..792fea417637493814071850e780e992 +import shadow.org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.PLUGIN_CACHE_FILE +import java.text.SimpleDateFormat +import java.util.Date ++import java.util.Locale + +plugins { + java @@ -64,38 +65,39 @@ index 0000000000000000000000000000000000000000..792fea417637493814071850e780e992 +} + +tasks.jar { ++ archiveClassifier.set("dev") ++ + manifest { + val git = Git(rootProject.layout.projectDirectory.path) -+ val gitHashCmd = git("rev-parse", "HEAD") -+ val gitHash = gitHashCmd.getText().substring(0, 7) -+ attributes(mapOf( ++ val gitHash = git("rev-parse", "HEAD").getText().substring(0, 7) ++ attributes( + "Main-Class" to "org.bukkit.craftbukkit.Main", + "Implementation-Title" to "CraftBukkit", + "Implementation-Version" to "git-Paper-\"$gitHash\"", + "Implementation-Vendor" to SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(Date()), // Paper + "Specification-Title" to "Bukkit", + "Specification-Version" to project.version, -+ "Specification-Vendor" to "Bukkit Team" -+ )) -+ for (tld in listOf("net", "com", "org")) { -+ attributes(mapOf( -+ "Sealed" to "true" -+ ), "$tld/bukkit") ++ "Specification-Vendor" to "Bukkit Team", ++ ) ++ for (tld in setOf("net", "com", "org")) { ++ attributes("$tld/bukkit", "Sealed" to true) + } + } +} + -+configure { ++publishing { + publications.create("maven") { -+ // todo: confirm this is correct -+ from(components["java"]) ++ artifactId = rootProject.name.toLowerCase(Locale.ENGLISH) + artifact(tasks.reobfJar) { -+ classifier = "reobf" ++ classifier = null + } ++ artifact(tasks.shadowJar) + } +} + +tasks.shadowJar { ++ archiveClassifier.set("mojang-mapped") ++ + listOf( + "jline", "it.unimi", "org.apache.commons.codec", "org.apache.commons.io", + "org.apache.commons.lang3", "org.objectweb.asm" diff --git a/patches/server/0003-Build-system-changes.patch b/patches/server/0003-Build-system-changes.patch index 6281f539c..75e27e199 100644 --- a/patches/server/0003-Build-system-changes.patch +++ b/patches/server/0003-Build-system-changes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Build system changes diff --git a/build.gradle.kts b/build.gradle.kts -index 792fea417637493814071850e780e9923d75a637..c255556783133278aaa0720969324f4c870ad7be 100644 +index 84af6353d060c65d5f125559becc011aeba8a842..4d6e92815951c3291fb865381677c52673e53462 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -21,21 +21,24 @@ repositories { +@@ -22,21 +22,24 @@ repositories { dependencies { implementation(project(":Paper-API")) implementation("jline:jline:2.12.1") @@ -37,23 +37,23 @@ index 792fea417637493814071850e780e9923d75a637..c255556783133278aaa0720969324f4c testImplementation("junit:junit:4.13.1") testImplementation("org.hamcrest:hamcrest-library:1.3") } -@@ -52,7 +55,8 @@ tasks.jar { - "Implementation-Vendor" to SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(Date()), // Paper +@@ -55,6 +58,7 @@ tasks.jar { "Specification-Title" to "Bukkit", "Specification-Version" to project.version, -- "Specification-Vendor" to "Bukkit Team" -+ "Specification-Vendor" to "Bukkit Team", -+ "Multi-Release" to "true" // Paper - )) - for (tld in listOf("net", "com", "org")) { - attributes(mapOf( -@@ -72,9 +76,17 @@ configure { + "Specification-Vendor" to "Bukkit Team", ++ "Multi-Release" to "true", // Paper + ) + for (tld in setOf("net", "com", "org")) { + attributes("$tld/bukkit", "Sealed" to true) +@@ -72,11 +76,19 @@ publishing { } } +val generatePom = tasks.named("generatePomFileForMavenPublication") + tasks.shadowJar { + archiveClassifier.set("mojang-mapped") + + // Needed for Paperclip's install to maven local feature + from(generatePom) { + into("META-INF/maven/io.papermc.paper/paper") diff --git a/patches/server/0138-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0138-Use-TerminalConsoleAppender-for-console-improvements.patch index 5fa80f240..57fa6f2e6 100644 --- a/patches/server/0138-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/0138-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -19,10 +19,10 @@ Other changes: configuration diff --git a/build.gradle.kts b/build.gradle.kts -index c255556783133278aaa0720969324f4c870ad7be..a2346d6ca23ab24c5fe6048a2ab3d7cad23ad091 100644 +index 3064f56ecb24415be2662aa1bcfbc5facfdb86dc..a3e4d9d5a1829533f1419f9ca124c5209a489938 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -20,7 +20,17 @@ repositories { +@@ -21,7 +21,17 @@ repositories { dependencies { implementation(project(":Paper-API")) diff --git a/patches/server/0158-Handle-plugin-prefixes-using-Log4J-configuration.patch b/patches/server/0158-Handle-plugin-prefixes-using-Log4J-configuration.patch index f37426e4f..0f1eedfd8 100644 --- a/patches/server/0158-Handle-plugin-prefixes-using-Log4J-configuration.patch +++ b/patches/server/0158-Handle-plugin-prefixes-using-Log4J-configuration.patch @@ -15,10 +15,10 @@ This may cause additional prefixes to be disabled for plugins bypassing the plugin logger. diff --git a/build.gradle.kts b/build.gradle.kts -index a2346d6ca23ab24c5fe6048a2ab3d7cad23ad091..03c157bb563b6c7b89e56e4c8e9c31b221b17bf9 100644 +index a3e4d9d5a1829533f1419f9ca124c5209a489938..7f34898ab177269803246a2be39763e3438b514c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -29,7 +29,7 @@ dependencies { +@@ -30,7 +30,7 @@ dependencies { all its classes to check if they are plugins. Scanning takes about 1-2 seconds so adding this speeds up the server start. */ diff --git a/patches/server/0225-Use-asynchronous-Log4j-2-loggers.patch b/patches/server/0225-Use-asynchronous-Log4j-2-loggers.patch index c8c5e93cb..513658374 100644 --- a/patches/server/0225-Use-asynchronous-Log4j-2-loggers.patch +++ b/patches/server/0225-Use-asynchronous-Log4j-2-loggers.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use asynchronous Log4j 2 loggers diff --git a/build.gradle.kts b/build.gradle.kts -index 03c157bb563b6c7b89e56e4c8e9c31b221b17bf9..ef743e289163cd7dc73a01f0aae784cb6c11d970 100644 +index 7f34898ab177269803246a2be39763e3438b514c..98899f57a859a78dc4445dae6c5448818e3cdd2d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -41,6 +41,7 @@ dependencies { +@@ -42,6 +42,7 @@ dependencies { } runtimeOnly("org.xerial:sqlite-jdbc:3.34.0") runtimeOnly("mysql:mysql-connector-java:8.0.23") // Paper diff --git a/patches/server/0426-Implement-Brigadier-Mojang-API.patch b/patches/server/0426-Implement-Brigadier-Mojang-API.patch index 1ab114185..fc23c8555 100644 --- a/patches/server/0426-Implement-Brigadier-Mojang-API.patch +++ b/patches/server/0426-Implement-Brigadier-Mojang-API.patch @@ -10,10 +10,10 @@ Adds CommandRegisteredEvent - Allows manipulating the CommandNode to add more children/metadata for the client diff --git a/build.gradle.kts b/build.gradle.kts -index ef743e289163cd7dc73a01f0aae784cb6c11d970..f1cbacb9f87f15c4cc2d1999cdb17a47eca9a7c3 100644 +index 98899f57a859a78dc4445dae6c5448818e3cdd2d..81e176070c1f5bbc3deb062a4663bdf66bee14b5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -20,6 +20,7 @@ repositories { +@@ -21,6 +21,7 @@ repositories { dependencies { implementation(project(":Paper-API")) diff --git a/patches/server/0432-Implement-Mob-Goal-API.patch b/patches/server/0432-Implement-Mob-Goal-API.patch index 42a8e60e8..c1421da81 100644 --- a/patches/server/0432-Implement-Mob-Goal-API.patch +++ b/patches/server/0432-Implement-Mob-Goal-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement Mob Goal API diff --git a/build.gradle.kts b/build.gradle.kts -index f1cbacb9f87f15c4cc2d1999cdb17a47eca9a7c3..7c99d0d173c8b36e26f90ec2126f3924997e6fa9 100644 +index 81e176070c1f5bbc3deb062a4663bdf66bee14b5..44fd50b5c566c218b83d602f941f33436afe2f39 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -51,6 +51,7 @@ dependencies { +@@ -52,6 +52,7 @@ dependencies { implementation("co.aikar:cleaner:1.0-SNAPSHOT") // Paper implementation("io.netty:netty-all:4.1.65.Final") // Paper diff --git a/patches/server/0625-Add-support-for-hex-color-codes-in-console.patch b/patches/server/0625-Add-support-for-hex-color-codes-in-console.patch index 31ce6553d..8a8f780bb 100644 --- a/patches/server/0625-Add-support-for-hex-color-codes-in-console.patch +++ b/patches/server/0625-Add-support-for-hex-color-codes-in-console.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add support for hex color codes in console Converts upstream's hex color code legacy format into actual hex color codes in the console. diff --git a/build.gradle.kts b/build.gradle.kts -index 7c99d0d173c8b36e26f90ec2126f3924997e6fa9..f111042223f0d7974785c37245bb60b75388163e 100644 +index 44fd50b5c566c218b83d602f941f33436afe2f39..6e29de72732682331d0d0c6bcf7eb33a1b899797 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -31,6 +31,7 @@ dependencies { +@@ -32,6 +32,7 @@ dependencies { Scanning takes about 1-2 seconds so adding this speeds up the server start. */ implementation("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - implementation