Skip to content

Migrate to DGPv2 #527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import java.net.URL
import javax.xml.parsers.DocumentBuilderFactory
import java.io.ByteArrayOutputStream
import java.io.PrintWriter
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.konan.target.Family
Expand Down Expand Up @@ -379,26 +378,31 @@ val downloadWindowsZonesMapping by tasks.registering {
}
}

tasks.withType<AbstractDokkaLeafTask>().configureEach {
pluginsMapConfiguration.set(mapOf("org.jetbrains.dokka.base.DokkaBase" to """{ "templatesDir" : "${projectDir.toString().replace('\\', '/')}/dokka-templates" }"""))
dokka {
pluginsConfiguration.html {
templatesDir.set(projectDir.resolve("dokka-templates"))
}

dokkaPublications.html {
failOnWarning.set(true)
// Enum members and undocumented toString()
suppressInheritedMembers.set(true)
}

failOnWarning.set(true)
dokkaSourceSets.configureEach {
val testSourceSet = kotlin.sourceSets.named("${name.dropLast(4)}Test")
samples.from(testSourceSet.map { it.kotlin.srcDirs })
val platform = name.dropLast(4)
samples.from("$platform/test")

// reportUndocumented.set(true) // much noisy output about `hashCode` and serializer encoders, decoders etc
skipDeprecated.set(true)
// Enum members and undocumented toString()
suppressInheritedMembers.set(true)
// hide the `internal` package, which, on JS, has public members generated by Dukat that would get mentioned
perPackageOption {
matchingRegex.set(".*\\.internal(\\..*)?")
suppress.set(true)
}
sourceLink {
localDirectory.set(rootDir)
remoteUrl.set(URL("https://github.com/kotlin/kotlinx-datetime/tree/latest-release"))
remoteUrl("https://github.com/kotlin/kotlinx-datetime/tree/latest-release")
remoteLineSuffix.set("#L")
}
}
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ kotlin.native.ignoreIncorrectDependencies=true
kotlin.native.ignoreDisabledTargets=true
kotlin.mpp.applyDefaultHierarchyTemplate=false

org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.nowarn=true

# stop using pre-HMPP IDEA import workaround in kotlinx.team.infra
useNativeBuildInfraInIdea=true