From eeb3dea61b6a6e606bacad7f78c52108ee5d7be4 Mon Sep 17 00:00:00 2001 From: Jason <11360596+jpenilla@users.noreply.github.com> Date: Tue, 26 Oct 2021 19:45:45 -0700 Subject: [PATCH] [ci skip] Resolve apiAndDocs sources during Javadoc task execution rather than during configuration time (#6836) --- .../api/0001-Convert-project-to-Gradle.patch | 9 +++++---- patches/api/0002-Build-system-changes.patch | 4 ++-- patches/api/0007-Adventure.patch | 18 +++++++++++++----- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/patches/api/0001-Convert-project-to-Gradle.patch b/patches/api/0001-Convert-project-to-Gradle.patch index 1b45bedb1b..7e2037f8b0 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..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().configureEach { ++tasks.withType { + (options as StandardJavadocDocletOptions).links( + "https://guava.dev/releases/21.0/api/docs/", + "https://javadoc.io/doc/org.yaml/snakeyaml/1.28/", diff --git a/patches/api/0002-Build-system-changes.patch b/patches/api/0002-Build-system-changes.patch index c34e26a986..1a45269c1f 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 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().configureEach { +@@ -62,7 +70,7 @@ tasks.withType { (options as StandardJavadocDocletOptions).links( "https://guava.dev/releases/21.0/api/docs/", "https://javadoc.io/doc/org.yaml/snakeyaml/1.28/", diff --git a/patches/api/0007-Adventure.patch b/patches/api/0007-Adventure.patch index 65b410bcb4..6da300d95d 100644 --- a/patches/api/0007-Adventure.patch +++ b/patches/api/0007-Adventure.patch @@ -7,7 +7,7 @@ Co-authored-by: zml Co-authored-by: Jake Potrebic 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().configureEach { -+ (options as CoreJavadocOptions).addStringOption("sourcepath", apiAndDocs.resolvedConfiguration.files.joinToString(separator = File.pathSeparator, transform = File::getPath)) + tasks.withType { ++ 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/",