From 8bd03162f0e6800a0b8e03d854eaf69088b5948e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:44:31 +0000 Subject: [PATCH] docs: publish dokka javadoc (#53) --- build.gradle.kts | 14 ++++++++++++++ .../src/main/kotlin/anthropic.publish.gradle.kts | 10 +++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 14591a8..4db7dcd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,18 @@ +plugins { + id("org.jetbrains.dokka") version "2.0.0" +} + allprojects { group = "com.anthropic" version = "0.1.0-alpha.6" // x-release-please-version } + +subprojects { + apply(plugin = "org.jetbrains.dokka") +} + +tasks.register("dokkaJavadocJar") { + dependsOn(tasks.dokkaJavadoc) + from(tasks.dokkaJavadoc.flatMap { it.outputDirectory }) + archiveClassifier.set("javadoc") +} diff --git a/buildSrc/src/main/kotlin/anthropic.publish.gradle.kts b/buildSrc/src/main/kotlin/anthropic.publish.gradle.kts index 0c1d863..ded6887 100644 --- a/buildSrc/src/main/kotlin/anthropic.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/anthropic.publish.gradle.kts @@ -1,3 +1,5 @@ +import com.vanniktech.maven.publish.JavadocJar +import com.vanniktech.maven.publish.KotlinJvm import com.vanniktech.maven.publish.MavenPublishBaseExtension import com.vanniktech.maven.publish.SonatypeHost @@ -18,7 +20,13 @@ configure { signAllPublications() publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) - this.coordinates(project.group.toString(), project.name, project.version.toString()) + coordinates(project.group.toString(), project.name, project.version.toString()) + configure( + KotlinJvm( + javadocJar = JavadocJar.Dokka("dokkaJavadoc"), + sourcesJar = true, + ) + ) pom { name.set("Anthropic API")