diff --git a/build-logic/src/main/kotlin/io/github/reactivecircus/cache4k/buildlogic/convention/ConventionPlugin.kt b/build-logic/src/main/kotlin/io/github/reactivecircus/cache4k/buildlogic/convention/ConventionPlugin.kt index 5207813..1fb0535 100644 --- a/build-logic/src/main/kotlin/io/github/reactivecircus/cache4k/buildlogic/convention/ConventionPlugin.kt +++ b/build-logic/src/main/kotlin/io/github/reactivecircus/cache4k/buildlogic/convention/ConventionPlugin.kt @@ -21,7 +21,7 @@ import org.gradle.kotlin.dsl.invoke import org.gradle.kotlin.dsl.register import org.gradle.kotlin.dsl.the import org.gradle.kotlin.dsl.withType -import org.jetbrains.dokka.gradle.DokkaMultiModuleTask +import org.jetbrains.dokka.gradle.DokkaExtension import org.jetbrains.dokka.gradle.DokkaPlugin import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.dsl.JsModuleKind @@ -44,11 +44,11 @@ internal class ConventionPlugin : Plugin { } private fun Project.configureRootProject() { - tasks.withType().configureEach { - val apiDir = rootDir.resolve("docs/api") - outputDirectory.set(apiDir) - doLast { - apiDir.resolve("-modules.html").renameTo(apiDir.resolve("index.html")) + plugins.withId("org.jetbrains.dokka") { + extensions.configure { + dokkaPublications.configureEach { + outputDirectory.set(layout.buildDirectory.dir("docs/api")) + } } } diff --git a/build.gradle.kts b/build.gradle.kts index f8e5b85..8d46ce5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,7 @@ plugins { id("cache4k.convention") } + +dependencies { + dokka(project(":cache4k")) +} diff --git a/gradle.properties b/gradle.properties index c1c3147..3563391 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,3 +22,5 @@ kotlin.code.style=official kotlin.native.binary.gc=cms kotlin.incremental.native=true + +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b523c49..b40df24 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] kotlin = "2.1.0" -dokka = "1.9.20" +dokka = "2.0.0" binaryCompabilityValidator = "0.15.1" toolchainsResolver = "0.8.0" detekt = "1.23.7"