Skip to content

Commit

Permalink
Migrate to new Dokka 2 APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonMarquis committed Dec 17, 2024
1 parent 03241b1 commit 11f8ec4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ org.gradle.kotlin.dsl.precompiled.accessors.strict=true
# Forced increase of Metaspace
# https://github.com/gradle/gradle/issues/23698
org.gradle.jvmargs=-XX:MaxMetaspaceSize=1g

# Dokka 2
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ kspApi = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref

[plugins]
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
dokka-javadoc = { id = "org.jetbrains.dokka-javadoc", version.ref = "dokka" }
jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.16.3" }
Expand Down
23 changes: 11 additions & 12 deletions processor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ plugins {
alias(libs.plugins.ksp)
alias(libs.plugins.binaryCompatibilityValidator)
alias(libs.plugins.dokka)
alias(libs.plugins.dokka.javadoc)
`maven-publish`
signing
}
Expand Down Expand Up @@ -71,25 +72,23 @@ val javadocJar by tasks.registering(Jar::class) {
archiveClassifier = "javadoc"
}

tasks.dokkaJavadoc.configure {
moduleName = "SealedObjectInstances"
outputDirectory = rootProject.layout.buildDirectory.dir("javadoc")
dokka {
moduleName.set("SealedObjectInstances")
dokkaPublications.html {
outputDirectory.set(rootProject.layout.buildDirectory.dir("dokka"))
}
dokkaPublications.javadoc {
outputDirectory.set(rootProject.layout.buildDirectory.dir("javadoc"))
}
}

val dokkaJavadocJar by tasks.registering(Jar::class) {
dependsOn(tasks.dokkaJavadoc)
from(tasks.dokkaJavadoc.get().outputDirectory)
from(tasks.dokkaGeneratePublicationJavadoc.flatMap { it.outputDirectory })
archiveClassifier = "javadoc"
}

tasks.dokkaHtml.configure {
moduleName = "SealedObjectInstances"
outputDirectory = rootProject.layout.buildDirectory.dir("dokka")
}

val dokkaHtmlJar by tasks.registering(Jar::class) {
dependsOn(tasks.dokkaHtml)
from(tasks.dokkaHtml.get().outputDirectory)
from(tasks.dokkaGeneratePublicationHtml.flatMap { it.outputDirectory })
archiveClassifier = "html-docs"
}

Expand Down

0 comments on commit 11f8ec4

Please # to comment.