[ci skip] Resolve apiAndDocs sources during Javadoc task execution rather than during configuration time (#6836)

This commit is contained in:
Jason 2021-10-26 19:45:45 -07:00 committed by GitHub
parent f2cb9cbd76
commit eeb3dea61b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 11 deletions

View file

@ -27,10 +27,10 @@ index e431e3435737e28394d81b56568a08b3c3148b9b..b23bde3b5e881f146539a307d0a59f21
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000000000000000000000000000000000000..fd30d2e6d3716777be7bc2f28267ab5b03131342
index 0000000000000000000000000000000000000000..997a70e2150d3de51d5d9185bdbba5535a9db1d9
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,67 @@
@@ -0,0 +1,68 @@
+import java.util.Locale
+
+plugins {
@ -72,6 +72,7 @@ index 0000000000000000000000000000000000000000..fd30d2e6d3716777be7bc2f28267ab5b
+}
+
+val generateApiVersioningFile by tasks.registering {
+ inputs.property("version", project.version)
+ val pomProps = layout.buildDirectory.file("pom.properties")
+ outputs.file(pomProps)
+ doLast {
@ -84,13 +85,13 @@ index 0000000000000000000000000000000000000000..fd30d2e6d3716777be7bc2f28267ab5b
+ into("META-INF/maven/${project.group}/${project.name.toLowerCase(Locale.ENGLISH)}")
+ }
+ manifest {
+ attributes += mapOf(
+ attributes(
+ "Automatic-Module-Name" to "org.bukkit"
+ )
+ }
+}
+
+tasks.withType<Javadoc>().configureEach {
+tasks.withType<Javadoc> {
+ (options as StandardJavadocDocletOptions).links(
+ "https://guava.dev/releases/21.0/api/docs/",
+ "https://javadoc.io/doc/org.yaml/snakeyaml/1.28/",

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts
index fd30d2e6d3716777be7bc2f28267ab5b03131342..5680b121034415a488d674df4401e0653adb4fed 100644
index 997a70e2150d3de51d5d9185bdbba5535a9db1d9..a781bd61e2968a29cd3b8f14a85555486c32cb63 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -14,18 +14,26 @@ dependencies {
@ -37,7 +37,7 @@ index fd30d2e6d3716777be7bc2f28267ab5b03131342..5680b121034415a488d674df4401e065
testImplementation("junit:junit:4.13.1")
testImplementation("org.hamcrest:hamcrest-library:1.3")
testImplementation("org.ow2.asm:asm-tree:9.2")
@@ -61,7 +69,7 @@ tasks.withType<Javadoc>().configureEach {
@@ -62,7 +70,7 @@ tasks.withType<Javadoc> {
(options as StandardJavadocDocletOptions).links(
"https://guava.dev/releases/21.0/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/1.28/",

View file

@ -7,7 +7,7 @@ Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/build.gradle.kts b/build.gradle.kts
index 3a395a44ff50a77895341bbbfb8c81deede41b8b..0a49a70a8f70e9b0af1eb5cff10884b98f86da7d 100644
index ca45f6ce0bc9f57158f3be6f56a3a7566e5ee720..ccf1912af727b68d1f1bfa1b73b43951ddfbe0ec 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -10,6 +10,19 @@ java {
@ -15,7 +15,7 @@ index 3a395a44ff50a77895341bbbfb8c81deede41b8b..0a49a70a8f70e9b0af1eb5cff10884b9
}
+val adventureVersion = "4.9.2"
+val apiAndDocs by configurations.creating {
+val apiAndDocs: Configuration by configurations.creating {
+ attributes {
+ attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
+ attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
@ -42,11 +42,19 @@ index 3a395a44ff50a77895341bbbfb8c81deede41b8b..0a49a70a8f70e9b0af1eb5cff10884b9
compileOnly("org.apache.maven:maven-resolver-provider:3.8.1")
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0")
@@ -67,10 +85,17 @@ tasks.jar {
@@ -68,10 +86,25 @@ tasks.jar {
}
tasks.withType<Javadoc>().configureEach {
+ (options as CoreJavadocOptions).addStringOption("sourcepath", apiAndDocs.resolvedConfiguration.files.joinToString(separator = File.pathSeparator, transform = File::getPath))
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/21.0/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/1.28/",