From 0f4bd382396ce42fdd645218093a6d105dbf0d00 Mon Sep 17 00:00:00 2001 From: Jack Boswell Date: Sat, 6 Apr 2024 14:37:34 +1300 Subject: [PATCH] Configure pages and javadoc in publishing plugin (#63) * Configure pages and javadoc in publishing plugin * 1.3.2 --- README.md | 2 +- build.gradle.kts | 2 -- buildSrc/build.gradle.kts | 4 ++++ .../kotlin/com.boswelja.publish.gradle.kts | 24 +++++++++++++++++++ core/build.gradle.kts | 17 ------------- gradle.properties | 2 +- material3/build.gradle.kts | 17 ------------- 7 files changed, 30 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index c44d707..fb1080f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ An AndroidX MenuHost & MenuProvider-like API for Jetpack Compose! kotlin { sourceSets { commonMain.dependencies { - val menuproviderVersion = "1.3.1" + val menuproviderVersion = "1.3.2" // Core provides a generic implementation fit for any design system implementation("io.github.boswelja.menuprovider:core:$menuproviderVersion") diff --git a/build.gradle.kts b/build.gradle.kts index a594987..7b5576f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,8 +3,6 @@ plugins { alias(libs.plugins.kotlin.multiplatform) apply false alias(libs.plugins.detekt) apply false alias(libs.plugins.compose.multiplatform) apply false - - alias(libs.plugins.dokka) } repositories { diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index bc0172f..424d793 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,3 +1,7 @@ plugins { `kotlin-dsl` } + +dependencies { + implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.9.20") +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/com.boswelja.publish.gradle.kts b/buildSrc/src/main/kotlin/com.boswelja.publish.gradle.kts index 4bd2c8e..cadf4ef 100644 --- a/buildSrc/src/main/kotlin/com.boswelja.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/com.boswelja.publish.gradle.kts @@ -1,4 +1,8 @@ +import org.jetbrains.dokka.gradle.DokkaTaskPartial +import java.net.URL + plugins { + id("org.jetbrains.dokka") id("maven-publish") id("signing") } @@ -22,6 +26,25 @@ signing { } afterEvaluate { + tasks.withType().configureEach { + dokkaSourceSets.configureEach { + includes.from("MODULE.md") + sourceLink { + localDirectory.set(projectDir.resolve("src")) + remoteUrl.set(URL("${extension.repositoryUrl.get()}/tree/main/${project.name}/src")) + remoteLineSuffix.set("#L") + } + } + } + + val dokkaHtml by tasks.getting(org.jetbrains.dokka.gradle.DokkaTask::class) + + val javadocJar: TaskProvider by tasks.registering(Jar::class) { + dependsOn(dokkaHtml) + archiveClassifier.set("javadoc") + from(dokkaHtml.outputDirectory) + } + publishing { repositories { if (System.getenv("PUBLISHING") == "true") { @@ -47,6 +70,7 @@ afterEvaluate { } publications.withType { + artifact(javadocJar) pom { name = project.name description = extension.description diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 86960b7..c848a03 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -10,8 +10,6 @@ plugins { alias(libs.plugins.detekt) - alias(libs.plugins.dokka) - id("com.boswelja.publish") } @@ -113,18 +111,3 @@ publish { repositoryUrl = "https://github.com/boswelja/compose-menuprovider" license = "MIT" } - -tasks.withType().configureEach { - dokkaSourceSets.configureEach { - includes.from("MODULE.md") - externalDocumentationLink( - url = "https://developer.android.com/reference/kotlin/", - packageListUrl = "https://developer.android.com/reference/kotlin/androidx/package-list" - ) - sourceLink { - localDirectory.set(projectDir.resolve("src")) - remoteUrl.set(URL("https://github.com/boswelja/compose-menuprovider/tree/main/core/src")) - remoteLineSuffix.set("#L") - } - } -} diff --git a/gradle.properties b/gradle.properties index 7ad576b..5d6cfdb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ android.useAndroidX=true kotlin.code.style=official # Below here is all packaging details, not build configuration. -version=1.3.1 +version=1.3.2 group=io.github.boswelja.menuprovider org.jetbrains.compose.experimental.macos.enabled=true diff --git a/material3/build.gradle.kts b/material3/build.gradle.kts index 16c3f32..3575f28 100644 --- a/material3/build.gradle.kts +++ b/material3/build.gradle.kts @@ -10,8 +10,6 @@ plugins { alias(libs.plugins.detekt) - alias(libs.plugins.dokka) - id("com.boswelja.publish") } @@ -103,18 +101,3 @@ publish { repositoryUrl = "https://github.com/boswelja/compose-menuprovider" license = "MIT" } - -tasks.withType().configureEach { - dokkaSourceSets.configureEach { - includes.from("MODULE.md") - externalDocumentationLink( - url = "https://developer.android.com/reference/kotlin/", - packageListUrl = "https://developer.android.com/reference/kotlin/androidx/package-list" - ) - sourceLink { - localDirectory.set(projectDir.resolve("src")) - remoteUrl.set(URL("https://github.com/boswelja/compose-menuprovider/tree/main/material3/src")) - remoteLineSuffix.set("#L") - } - } -}