Skip to content

Commit

Permalink
declare capabilities for old artifact id and alternate api implementa…
Browse files Browse the repository at this point in the history
…tions

closes PaperMC#7190
  • Loading branch information
jpenilla committed Dec 25, 2021
1 parent 464b171 commit 498a265
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 14 deletions.
12 changes: 12 additions & 0 deletions Paper-MojangAPI/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ dependencies {
testImplementation("org.ow2.asm:asm-tree:7.3.1")
}

configurations {
val outgoing = arrayOf(runtimeElements, apiElements, named("sourcesElements"), named("javadocElements"))
for (config in outgoing) {
config {
outgoing {
capability("${project.group}:${project.name}:${project.version}")
capability("com.destroystokyo.paper:paper-mojangapi:${project.version}")
}
}
}
}

configure<PublishingExtension> {
publications.create<MavenPublication>("maven") {
from(components["java"])
Expand Down
27 changes: 24 additions & 3 deletions patches/api/0002-Build-system-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,31 @@ Subject: [PATCH] Build system changes


diff --git a/build.gradle.kts b/build.gradle.kts
index c76bfbcfbe034700bdbd9396643cfca625273a14..1f680baffba17265e8ce38b3516624bffd034075 100644
index c76bfbcfbe034700bdbd9396643cfca625273a14..2ab670041bd82cab8d51dbc53a796a51d54e5f34 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -15,15 +15,27 @@ dependencies {
@@ -8,6 +8,20 @@ java {
withJavadocJar()
}

+configurations {
+ val outgoing = arrayOf(runtimeElements, apiElements, named("sourcesElements"), named("javadocElements"))
+ for (config in outgoing) {
+ config {
+ outgoing {
+ capability("${project.group}:${project.name}:${project.version}")
+ capability("com.destroystokyo.paper:paper-api:${project.version}")
+ capability("org.spigotmc:spigot-api:${project.version}")
+ capability("org.bukkit:bukkit-api:${project.version}")
+ }
+ }
+ }
+}
+
dependencies {
// api dependencies are listed transitively to API consumers
api("commons-lang:commons-lang:2.6")
@@ -15,15 +29,27 @@ dependencies {
api("com.google.code.gson:gson:2.8.8")
api("net.md-5:bungeecord-chat:1.16-R0.4")
api("org.yaml:snakeyaml:1.30")
Expand Down Expand Up @@ -37,7 +58,7 @@ index c76bfbcfbe034700bdbd9396643cfca625273a14..1f680baffba17265e8ce38b3516624bf
testImplementation("junit:junit:4.13.2")
testImplementation("org.hamcrest:hamcrest-library:1.3")
testImplementation("org.ow2.asm:asm-tree:9.2")
@@ -60,7 +72,7 @@ tasks.withType<Javadoc> {
@@ -60,7 +86,7 @@ tasks.withType<Javadoc> {
(options as StandardJavadocDocletOptions).links(
"https://guava.dev/releases/31.0.1-jre/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/1.30/",
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0004-Add-FastUtil-to-Bukkit.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 364b6215d2facb0273a67ff605ccb8e707e080b8..3777d12874ede329410a6bf1c0533deb44924d73 100644
index 2ab670041bd82cab8d51dbc53a796a51d54e5f34..dd18099ebbabfc785c67c1d48b0b88628ab3b24a 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -19,6 +19,7 @@ dependencies {
@@ -33,6 +33,7 @@ dependencies {
api("com.googlecode.json-simple:json-simple:1.1.1") {
isTransitive = false // includes junit
}
Expand Down
10 changes: 5 additions & 5 deletions patches/api/0008-Adventure.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Co-authored-by: zml <[email protected]>
Co-authored-by: Jake Potrebic <[email protected]>

diff --git a/build.gradle.kts b/build.gradle.kts
index 55ee0c6330e4dbba22b4044346d1e1dd39c745ce..80fdd05dd593455ca89b66636ed30f1d9facf4ed 100644
index dd18099ebbabfc785c67c1d48b0b88628ab3b24a..a045e4979ae29b9c4c57ea54736ce3c7d5054cf3 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,6 +8,19 @@ java {
withJavadocJar()
@@ -22,6 +22,19 @@ configurations {
}
}

+val adventureVersion = "4.9.3"
Expand All @@ -30,7 +30,7 @@ index 55ee0c6330e4dbba22b4044346d1e1dd39c745ce..80fdd05dd593455ca89b66636ed30f1d
dependencies {
// api dependencies are listed transitively to API consumers
api("commons-lang:commons-lang:2.6")
@@ -20,6 +33,11 @@ dependencies {
@@ -34,6 +47,11 @@ dependencies {
isTransitive = false // includes junit
}
api("it.unimi.dsi:fastutil:8.5.6")
Expand All @@ -42,7 +42,7 @@ index 55ee0c6330e4dbba22b4044346d1e1dd39c745ce..80fdd05dd593455ca89b66636ed30f1d
// Paper end

compileOnly("org.apache.maven:maven-resolver-provider:3.8.4")
@@ -70,10 +88,25 @@ tasks.jar {
@@ -84,10 +102,25 @@ tasks.jar {
}

tasks.withType<Javadoc> {
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0026-Use-ASM-for-event-executors.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 0e8e827b5a05ac9423386eaea4188d132cc7f954..70d6503745942ea8637146369aeab8f9357c42d5 100644
index a045e4979ae29b9c4c57ea54736ce3c7d5054cf3..8764cff67c435b1122fa79430b75563a5d83df0e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -38,6 +38,9 @@ dependencies {
@@ -52,6 +52,9 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-serializer-gson")
apiAndDocs("net.kyori:adventure-text-serializer-legacy")
apiAndDocs("net.kyori:adventure-text-serializer-plain")
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0069-Allow-plugins-to-use-SLF4J-for-logging.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 d8d459561cc75935136f8f9888ff27b45ad98f9e..a23b2bd8e1ca1ff8d0ad5ed5d5e41c89e4795090 100644
index 8764cff67c435b1122fa79430b75563a5d83df0e..1b2bfc2d860c4a51f13e305a0bf2897e131fb43f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -38,6 +38,8 @@ dependencies {
@@ -52,6 +52,8 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-serializer-gson")
apiAndDocs("net.kyori:adventure-text-serializer-legacy")
apiAndDocs("net.kyori:adventure-text-serializer-plain")
Expand Down

0 comments on commit 498a265

Please sign in to comment.