Put pom in correct location for Paperclip install to maven local feature

This commit is contained in:
Jason Penilla 2021-06-14 18:50:13 -07:00
parent efc6fa6a04
commit fdd125c43e
4 changed files with 36 additions and 2 deletions

View file

@ -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<PublishingExtension> {
publications.create<MavenPublication>("maven") {
from(components["java"])
}
}

View file

@ -24,6 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+plugins {
+ `java-library`
+ `maven-publish`
+}
+
+java {
@ -52,6 +53,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ testImplementation("org.ow2.asm:asm-tree:9.1")
+}
+
+configure<PublishingExtension> {
+ publications.create<MavenPublication>("maven") {
+ from(components["java"])
+ }
+}
+
+val generateApiVersioningFile by tasks.registering {
+ val pomProps = layout.buildDirectory.file("pom.properties")
+ outputs.file(pomProps)

View file

@ -47,9 +47,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
))
for (tld in listOf("net", "com", "org")) {
attributes(mapOf(
@@ -0,0 +0,0 @@ tasks.jar {
@@ -0,0 +0,0 @@ configure<PublishingExtension> {
}
}
+val generatePom = tasks.named<GenerateMavenPom>("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

View file

@ -21,7 +21,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +0,0 @@
+import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer
+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..00000000000000000000000000000000
+
+plugins {
+ java
+ `maven-publish`
+ id("com.github.johnrengelman.shadow")
+}
+
@ -86,6 +86,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+}
+
+configure<PublishingExtension> {
+ publications.create<MavenPublication>("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",