@@ -78,12 +78,13 @@ apiValidation {
78
78
79
79
knit {
80
80
siteRoot = " https://kotlinlang.org/api/kotlinx.serialization"
81
- moduleDocs = " build/dokka/htmlMultiModule"
81
+ moduleDocs = " build/dokka-module/html/module"
82
+ dokkaMultiModuleRoot = " build/dokka/html/"
82
83
}
83
84
84
85
// Build API docs for all modules with dokka before running Knit
85
86
tasks.named(" knitPrepare" ) {
86
- dependsOn(" dokka " )
87
+ dependsOn(" dokkaGenerate " )
87
88
}
88
89
89
90
@@ -135,17 +136,14 @@ subprojects {
135
136
}
136
137
}
137
138
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" )
147
141
dependencies {
148
- dokkaPlugin(libs.dokka.pathsaver)
142
+ subprojects.forEach {
143
+ if (it.name in documentedSubprojects) {
144
+ dokka(it)
145
+ }
146
+ }
149
147
}
150
148
151
149
// == NPM setup ==
@@ -159,19 +157,23 @@ logger.warn("Project is using Kotlin Gradle plugin version: ${project.getKotlinP
159
157
160
158
// == projects lists and flags ==
161
159
// 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
+ )
168
167
val excludedFromBomProjects get() = unpublishedProjects + " kotlinx-serialization-bom"
169
168
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