Fix artifact ids

This commit is contained in:
Jason Penilla 2021-06-16 16:23:02 -07:00
parent 7be3024c75
commit a26d1aa427
No known key found for this signature in database
GPG key ID: 0E75A301420E48F8
10 changed files with 46 additions and 40 deletions

View file

@ -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<PublishingExtension> {
+publishing {
+ publications.create<MavenPublication>("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"