vignesh
02/06/2025, 6:15 AMMoussa
02/06/2025, 6:22 AMAdam Semenenko
02/06/2025, 7:05 AMMoussa
02/06/2025, 7:07 AMAdam Semenenko
02/06/2025, 7:08 AMMoussa
02/06/2025, 7:10 AMAdam Semenenko
02/06/2025, 7:11 AMAdam Semenenko
02/06/2025, 7:14 AMAdam Semenenko
02/06/2025, 7:14 AMMoussa
02/06/2025, 8:31 AMDokka
team fully enable the new Dokka Gradle plugin
and exit experimental phase) using only Dokka
apis but the bellow is using their new Dokka Gradle plugin v2
In gradle.properties
# Dokka
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
In build.gradle.kts
plugins {
kotlin("jvm") version "2.1.0"
// OR
kotlin("multiplatform") version "2.1.0"
id("org.jetbrains.dokka") version "2.0.0"
}
buildscript {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.0")
classpath("com.android.tools.build:gradle:8.7.3")
classpath("org.jetbrains.dokka:dokka-base:2.0.0")
}
}
apply(plugin = "org.jetbrains.dokka")
dokka {
dokkaSourceSets.configureEach {
jdkVersion.set(20)
languageVersion.set("2.1.0")
apiVersion.set("2.0")
reportUndocumented.set(true)
documentedVisibilities(
VisibilityModifier.Public,
VisibilityModifier.Private,
VisibilityModifier.Internal,
VisibilityModifier.Protected
)
sourceLink {
localDirectory.set(projectDir.resolve("src/commonMain/kotlin"))
remoteUrl("<https://github.com/$USER/$REPO_NAME/tree/main/src>")
remoteLineSuffix.set("#L")
}
}
pluginsConfiguration {
html {
customAssets.from(rootDir.resolve("Logo.png"))
footerMessage.set("(c) 2025 $COMPANY_NAME Copyright")
}
}
}
And it is working as expected and generating the documentation and including the Private
membersvignesh
02/06/2025, 10:42 AMAdam Semenenko
02/06/2025, 10:42 AMvignesh
02/06/2025, 10:46 AMAdam Semenenko
02/06/2025, 10:50 AMAdam Semenenko
02/06/2025, 10:56 AMvignesh
02/06/2025, 11:00 AMAdam Semenenko
02/06/2025, 11:04 AMimport org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.DokkaConfiguration.Visibility
tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
documentedVisibilities.set(Visibility.values().toSet())
}
}
Do you have multiple subprojects? Because that config will need to be applied to each of themvignesh
02/06/2025, 11:08 AMvignesh
02/06/2025, 11:09 AMvignesh
02/07/2025, 4:25 AMOleg Yukhnevich
02/07/2025, 12:49 PMHi, Is it possible to maintain the folder hierarchy when creating the html output doc ?Hey, no, it's not possible. Could you tell me about why you might need it?
vignesh
02/07/2025, 2:18 PM