From 71e7c465d82dda46fbd4dc0b1a3c261f6a13f5fd Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sun, 4 Feb 2024 10:15:13 -0700 Subject: [PATCH] Use cloud-build-logic.javadoc-links for automatic javadoc linking (#395) --- api/build.gradle.kts | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/api/build.gradle.kts b/api/build.gradle.kts index 378a8f56..128b9700 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -1,28 +1,16 @@ plugins { id("carbon.publishing-conventions") + id("org.incendo.cloud-build-logic.javadoc-links") version "0.0.10" } description = "API for interfacing with the CarbonChat Minecraft mod/plugin" -val docs: Configuration by configurations.creating { - attributes { - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION)) - attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL)) - attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named(DocsType.SOURCES)) - attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME)) - } -} -configurations.compileOnlyApi { - extendsFrom(docs) -} - dependencies { // Doesn't add any dependencies, only version constraints api(platform(libs.adventureBom)) - docs(platform(libs.adventureBom)) // Provided by platform - docs(libs.adventureApi) + compileOnlyApi(libs.adventureApi) compileOnlyApi(libs.adventureTextSerializerPlain) compileOnlyApi(libs.adventureTextSerializerLegacy) compileOnlyApi(libs.adventureTextSerializerGson) { @@ -30,23 +18,8 @@ dependencies { } compileOnlyApi(libs.minimessage) - docs(libs.checkerQual) + compileOnlyApi(libs.checkerQual) // Provided by Minecraft compileOnlyApi(libs.gson) } - -tasks.withType { - val options = options as StandardJavadocDocletOptions - options.links( - "https://jd.advntr.dev/api/${libs.versions.adventure.get()}/", - "https://javadoc.io/doc/org.checkerframework/checker-qual/${libs.versions.checkerQual.get()}/", - ) - inputs.files(docs).ignoreEmptyDirectories().withPropertyName(docs.name + "-configuration") - doFirst { - options.addStringOption( - "sourcepath", - docs.resolvedConfiguration.files.joinToString(separator = File.pathSeparator, transform = File::getPath) - ) - } -}