Skip to content

Commit

Permalink
Configure pages and javadoc in publishing plugin (#63)
Browse files Browse the repository at this point in the history
* Configure pages and javadoc in publishing plugin

* 1.3.2
  • Loading branch information
boswelja authored Apr 6, 2024
1 parent 9ef9d5a commit 0f4bd38
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 38 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 0 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
`kotlin-dsl`
}

dependencies {
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.9.20")
}
24 changes: 24 additions & 0 deletions buildSrc/src/main/kotlin/com.boswelja.publish.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import java.net.URL

plugins {
id("org.jetbrains.dokka")
id("maven-publish")
id("signing")
}
Expand All @@ -22,6 +26,25 @@ signing {
}

afterEvaluate {
tasks.withType<DokkaTaskPartial>().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<Jar> by tasks.registering(Jar::class) {
dependsOn(dokkaHtml)
archiveClassifier.set("javadoc")
from(dokkaHtml.outputDirectory)
}

publishing {
repositories {
if (System.getenv("PUBLISHING") == "true") {
Expand All @@ -47,6 +70,7 @@ afterEvaluate {
}

publications.withType<MavenPublication> {
artifact(javadocJar)
pom {
name = project.name
description = extension.description
Expand Down
17 changes: 0 additions & 17 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ plugins {

alias(libs.plugins.detekt)

alias(libs.plugins.dokka)

id("com.boswelja.publish")
}

Expand Down Expand Up @@ -113,18 +111,3 @@ publish {
repositoryUrl = "https://github.com/boswelja/compose-menuprovider"
license = "MIT"
}

tasks.withType<DokkaTaskPartial>().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")
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 0 additions & 17 deletions material3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ plugins {

alias(libs.plugins.detekt)

alias(libs.plugins.dokka)

id("com.boswelja.publish")
}

Expand Down Expand Up @@ -103,18 +101,3 @@ publish {
repositoryUrl = "https://github.com/boswelja/compose-menuprovider"
license = "MIT"
}

tasks.withType<DokkaTaskPartial>().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")
}
}
}

0 comments on commit 0f4bd38

Please sign in to comment.