@@ -78,12 +78,13 @@ apiValidation {
7878
7979knit {
8080 siteRoot = " https://kotlinlang.org/api/kotlinx.serialization"
81- moduleDocs = " build/dokka/htmlMultiModule"
81+ moduleDocs = " build/dokka-module/html/module"
82+ dokkaMultiModuleRoot = " build/dokka/html/"
8283}
8384
8485// Build API docs for all modules with dokka before running Knit
8586tasks.named(" knitPrepare" ) {
86- dependsOn(" dokka " )
87+ dependsOn(" dokkaGenerate " )
8788}
8889
8990
@@ -135,17 +136,14 @@ subprojects {
135136 }
136137}
137138
138- // Knit relies on Dokka task and it's pretty convenient
139- tasks.register(" dokka" ) {
140- dependsOn(" dokkaHtmlMultiModule" )
141- }
142-
143- tasks.withType<DokkaMultiModuleTask >().named(" dokkaHtmlMultiModule" ) {
144- pluginsMapConfiguration.put(" org.jetbrains.dokka.base.DokkaBase" , """ { "templatesDir": "${projectDir.toString().replace(" \\ " , " /" )} /dokka-templates" }""" )
145- }
146-
139+ // apply conventions to root module and setup dependencies for aggregation
140+ apply (plugin = " dokka-conventions" )
147141dependencies {
148- dokkaPlugin(libs.dokka.pathsaver)
142+ subprojects.forEach {
143+ if (it.name in documentedSubprojects) {
144+ dokka(it)
145+ }
146+ }
149147}
150148
151149// == NPM setup ==
@@ -159,19 +157,23 @@ logger.warn("Project is using Kotlin Gradle plugin version: ${project.getKotlinP
159157
160158// == projects lists and flags ==
161159// getters are required because of variable lazy initialization in Gradle
162- val unpublishedProjects get() = setOf (
163- " benchmark" ,
164- " guide" ,
165- " kotlinx-serialization-json-tests" ,
166- " proto-test-model" ,
167- )
160+ val unpublishedProjects
161+ get() = setOf (
162+ " benchmark" ,
163+ " guide" ,
164+ " kotlinx-serialization-json-tests" ,
165+ " proto-test-model" ,
166+ )
168167val excludedFromBomProjects get() = unpublishedProjects + " kotlinx-serialization-bom"
169168
170- val documentedSubprojects get() = setOf (" kotlinx-serialization-core" ,
171- " kotlinx-serialization-json" ,
172- " kotlinx-serialization-json-okio" ,
173- " kotlinx-serialization-json-io" ,
174- " kotlinx-serialization-cbor" ,
175- " kotlinx-serialization-properties" ,
176- " kotlinx-serialization-hocon" ,
177- " kotlinx-serialization-protobuf" )
169+ val documentedSubprojects
170+ get() = setOf (
171+ " kotlinx-serialization-core" ,
172+ " kotlinx-serialization-json" ,
173+ " kotlinx-serialization-json-okio" ,
174+ " kotlinx-serialization-json-io" ,
175+ " kotlinx-serialization-cbor" ,
176+ " kotlinx-serialization-properties" ,
177+ " kotlinx-serialization-hocon" ,
178+ " kotlinx-serialization-protobuf"
179+ )
0 commit comments