Skip to content

Commit 9f9d567

Browse files
committed
Updated Dokka
1 parent 3eb3cd7 commit 9f9d567

2 files changed

Lines changed: 24 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
# Build
2525
- run: gradle build
26-
- run: gradle dokkaHtmlMultiModule
26+
- run: gradle dokkaGenerateHtml
2727
- run: gradle test
2828
- name: Report test results
2929
if: always()
@@ -58,5 +58,5 @@ jobs:
5858
with:
5959
github_token: ${{github.token}}
6060
force_orphan: true
61-
publish_dir: build/dokka/htmlMultiModule
61+
publish_dir: build/dokka/html
6262
cname: java.typedrest.net

build.gradle.kts

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ repositories.mavenCentral()
55
plugins {
66
kotlin("jvm") version "2.3.10"
77
kotlin("plugin.serialization") version "2.3.10" apply false
8-
id("org.jetbrains.dokka") version "1.9.20"
8+
id("org.jetbrains.dokka") version "2.1.0"
9+
id("org.jetbrains.dokka-javadoc") version "2.1.0"
910
}
1011

1112
subprojects {
@@ -18,14 +19,30 @@ subprojects {
1819
apply(plugin = kotlin("jvm"))
1920
apply(plugin = kotlin("plugin.serialization"))
2021
apply(plugin = "org.jetbrains.dokka")
22+
apply(plugin = "org.jetbrains.dokka-javadoc")
2123

2224
kotlin {
2325
compilerOptions.allWarningsAsErrors = true
2426
}
2527

26-
fun NamedDomainObjectContainer<GradleDokkaSourceSetBuilder>.addMarkdown() = configureEach {
27-
includes.from(project.files(), fileTree("src/main/kotlin").include("**/_doc.md"))
28+
dokka {
29+
dokkaSourceSets.configureEach {
30+
// Package-level documentation
31+
val mdFiles = fileTree("src/main/kotlin") {
32+
include("**/_doc.md")
33+
}
34+
mdFiles.files.forEach { mdFile ->
35+
// Avoid duplicate file name conflicts
36+
val relativePath = mdFile.relativeTo(project.file("src/main/kotlin")).path.replace("/", "-").replace("\\", "-")
37+
val uniqueFile = project.layout.buildDirectory.file("tmp/dokka-includes/$relativePath").get().asFile
38+
uniqueFile.parentFile.mkdirs()
39+
mdFile.copyTo(uniqueFile, overwrite = true)
40+
includes.from(uniqueFile)
41+
}
42+
}
2843
}
29-
tasks.withType<DokkaTask>().configureEach { dokkaSourceSets.addMarkdown() }
30-
tasks.withType<DokkaTaskPartial>().configureEach { dokkaSourceSets.addMarkdown() }
44+
}
45+
46+
dependencies {
47+
subprojects.forEach { dokka(it) }
3148
}

0 commit comments

Comments
 (0)