aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason Penilla <[email protected]>2022-02-28 21:38:49 -0700
committerJason Penilla <[email protected]>2022-02-28 22:52:40 -0700
commitab8a139612ec5ad3c4b75f7975095da2f0d5474e (patch)
tree3799827fa9a787f528ef7b8dd42b862889a7d934
parent126ca7376e368424ea0b6e473a31b16adb19ec7a (diff)
downloadPaper-ab8a139612ec5ad3c4b75f7975095da2f0d5474e.tar.gz
Paper-ab8a139612ec5ad3c4b75f7975095da2f0d5474e.zip
Configure javadoc overview and doc-files copying
closes #7462 Co-authored-by: Jake Potrebic <[email protected]>
-rw-r--r--patches/api/0001-Convert-project-to-Gradle.patch20
-rw-r--r--patches/api/0002-Build-system-changes.patch8
-rw-r--r--patches/api/0008-Adventure.patch31
3 files changed, 35 insertions, 24 deletions
diff --git a/patches/api/0001-Convert-project-to-Gradle.patch b/patches/api/0001-Convert-project-to-Gradle.patch
index 3627d13b6a..0035f2a6e9 100644
--- a/patches/api/0001-Convert-project-to-Gradle.patch
+++ b/patches/api/0001-Convert-project-to-Gradle.patch
@@ -27,10 +27,10 @@ index e431e3435737e28394d81b56568a08b3c3148b9b..b23bde3b5e881f146539a307d0a59f21
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
-index 0000000000000000000000000000000000000000..bf1f5a8151ac0a4b25370142fef37145033140ef
+index 0000000000000000000000000000000000000000..d6b99d37c960a7d8de1852dbc74c3ce671101b14
--- /dev/null
+++ b/build.gradle.kts
-@@ -0,0 +1,66 @@
+@@ -0,0 +1,80 @@
+plugins {
+ `java-library`
+ `maven-publish`
@@ -90,12 +90,26 @@ index 0000000000000000000000000000000000000000..bf1f5a8151ac0a4b25370142fef37145
+}
+
+tasks.withType<Javadoc> {
-+ (options as StandardJavadocDocletOptions).links(
++ val options = options as StandardJavadocDocletOptions
++ options.overview = "src/main/javadoc/overview.html"
++ options.isDocFilesSubDirs = true
++ options.links(
+ "https://guava.dev/releases/31.0.1-jre/api/docs/",
+ "https://javadoc.io/doc/org.yaml/snakeyaml/1.30/",
+ "https://javadoc.io/doc/org.jetbrains/annotations-java5/23.0.0/",
+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
+ )
++
++ // workaround for https://github.com/gradle/gradle/issues/4046
++ inputs.dir("src/main/javadoc").withPropertyName("javadoc-sourceset")
++ doLast {
++ copy {
++ from("src/main/javadoc") {
++ include("**/doc-files/**")
++ }
++ into("build/docs/javadoc")
++ }
++ }
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
diff --git a/patches/api/0002-Build-system-changes.patch b/patches/api/0002-Build-system-changes.patch
index 95ce3fbbe3..a428d131ec 100644
--- a/patches/api/0002-Build-system-changes.patch
+++ b/patches/api/0002-Build-system-changes.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts
-index bf1f5a8151ac0a4b25370142fef37145033140ef..709f9c3a562729970813f47b531bfc51ba192f55 100644
+index d6b99d37c960a7d8de1852dbc74c3ce671101b14..e49f4853e36f493754841231eeb5dd093b3788e0 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -15,15 +15,27 @@ dependencies {
@@ -37,12 +37,12 @@ index bf1f5a8151ac0a4b25370142fef37145033140ef..709f9c3a562729970813f47b531bfc51
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> {
- (options as StandardJavadocDocletOptions).links(
+@@ -63,7 +75,7 @@ tasks.withType<Javadoc> {
+ options.links(
"https://guava.dev/releases/31.0.1-jre/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/1.30/",
- "https://javadoc.io/doc/org.jetbrains/annotations-java5/23.0.0/",
+ "https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/", // Paper - we don't want Java 5 annotations
"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
)
- }
+
diff --git a/patches/api/0008-Adventure.patch b/patches/api/0008-Adventure.patch
index 5ddee589d2..f4c376056b 100644
--- a/patches/api/0008-Adventure.patch
+++ b/patches/api/0008-Adventure.patch
@@ -7,7 +7,7 @@ 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..19b65a9b56b73f873ef646d14a6cf091b69d3873 100644
+index 98afa6a25131dc626ea7a5122f33df6bd2d39178..bacb5650f03827ac55f8c8c33f6ffda5b029a8a4 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,6 +8,19 @@ java {
@@ -43,21 +43,7 @@ index 55ee0c6330e4dbba22b4044346d1e1dd39c745ce..19b65a9b56b73f873ef646d14a6cf091
// Paper end
compileOnly("org.apache.maven:maven-resolver-provider:3.8.4")
-@@ -70,10 +89,25 @@ tasks.jar {
- }
-
- tasks.withType<Javadoc> {
-+ inputs.files(apiAndDocs)
-+ .ignoreEmptyDirectories()
-+ .withPropertyName(apiAndDocs.name + "-configuration")
-+ doFirst {
-+ (options as CoreJavadocOptions).addStringOption(
-+ "sourcepath",
-+ apiAndDocs.resolvedConfiguration.files.joinToString(separator = File.pathSeparator, transform = File::getPath)
-+ )
-+ }
- (options as StandardJavadocDocletOptions).links(
- "https://guava.dev/releases/31.0.1-jre/api/docs/",
+@@ -78,8 +97,22 @@ tasks.withType<Javadoc> {
"https://javadoc.io/doc/org.yaml/snakeyaml/1.30/",
"https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/", // Paper - we don't want Java 5 annotations
"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
@@ -68,7 +54,18 @@ index 55ee0c6330e4dbba22b4044346d1e1dd39c745ce..19b65a9b56b73f873ef646d14a6cf091
+ "https://jd.adventure.kyori.net/text-serializer-plain/$adventureVersion/",
+ // Paper end
)
- }
+
++ inputs.files(apiAndDocs).ignoreEmptyDirectories().withPropertyName(apiAndDocs.name + "-configuration")
++ doFirst {
++ options.addStringOption(
++ "sourcepath",
++ apiAndDocs.resolvedConfiguration.files.joinToString(separator = File.pathSeparator, transform = File::getPath)
++ )
++ }
++
+ // workaround for https://github.com/gradle/gradle/issues/4046
+ inputs.dir("src/main/javadoc").withPropertyName("javadoc-sourceset")
+ doLast {
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
index ef58a6c00f444bd498a2d8fc4e457236f393954f..ecd149157d4fb80444f34bf5633d74bcdb63dec5 100644
--- a/src/main/java/co/aikar/timings/TimingsReportListener.java