diff --git a/gradle.properties b/gradle.properties index 4632b7e..aa5d802 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dfea98e..e11d764 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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" } diff --git a/processor/build.gradle.kts b/processor/build.gradle.kts index 021f8ba..d73c148 100644 --- a/processor/build.gradle.kts +++ b/processor/build.gradle.kts @@ -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 } @@ -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" }