From 2de3ca552be92800959c16b4b0da94c595c5235f Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Sun, 4 Feb 2024 02:28:00 +0100 Subject: [PATCH] Build javadocs for plugin sdk --- build.gradle.kts | 1 + core/shared/build.gradle.kts | 14 +++++++++++++- gradle/libs.versions.toml | 3 ++- plugins/sdk/build.gradle.kts | 16 ++++++++++++++-- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8fd31561..7081bed7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,6 +5,7 @@ plugins { alias(libs.plugins.protobuf) apply false alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false + alias(libs.plugins.dokka) apply false } apply(from = "docs/deps-graph.gradle") \ No newline at end of file diff --git a/core/shared/build.gradle.kts b/core/shared/build.gradle.kts index eb564cd8..e5dfd406 100644 --- a/core/shared/build.gradle.kts +++ b/core/shared/build.gradle.kts @@ -44,6 +44,15 @@ android { } } +tasks.dokkaHtml { + outputDirectory.set(layout.buildDirectory.dir("dokka")) +} + +val javadocJar by tasks.registering(Jar::class) { + archiveClassifier.set("javadoc") + from(tasks.dokkaHtml) +} + publishing { publications { register("release") { @@ -51,8 +60,11 @@ publishing { artifactId = "shared" version = "1.0.0-SNAPSHOT" + artifact(javadocJar) + pom { - name = "Kvaesitso SDK" + name = "Kvaesitso shared library" + description = "Contains shared code between the launcher and its plugin SDK" licenses { license { name = "The Apache License, Version 2.0" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1c113a0d..e0e583f8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -144,4 +144,5 @@ android-library = { id = "com.android.library", version.ref = "android-gradle-pl protobuf = { id = "com.google.protobuf", version.ref = "protobuf-gradle-plugin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp-gradle-plugin" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } -kotlin-plugin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } \ No newline at end of file +kotlin-plugin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } +dokka = { id = "org.jetbrains.dokka", version = "1.9.10" } \ No newline at end of file diff --git a/plugins/sdk/build.gradle.kts b/plugins/sdk/build.gradle.kts index fb7f122d..bf7258ac 100644 --- a/plugins/sdk/build.gradle.kts +++ b/plugins/sdk/build.gradle.kts @@ -2,6 +2,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.plugin.serialization) + alias(libs.plugins.dokka) `maven-publish` } @@ -56,6 +57,15 @@ dependencies { implementation(libs.bundles.kotlin) } +tasks.dokkaHtml { + outputDirectory.set(layout.buildDirectory.dir("dokka")) +} + +val javadocJar by tasks.registering(Jar::class) { + archiveClassifier.set("javadoc") + from(tasks.dokkaHtml) +} + publishing { publications { register("release") { @@ -63,9 +73,11 @@ publishing { artifactId = "plugin-sdk" version = "1.0.0-SNAPSHOT" + artifact(javadocJar) + pom { - name = "Kvaesitso shared library" - description = "Contains shared code between the launcher and its plugin SDK" + name = "Kvaesitso SDK" + description = "Plugin SDK for the Kvaesitso launcher" licenses { license { name = "The Apache License, Version 2.0"