aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/generation
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-08-31 20:16:01 +0200
committerGitHub <noreply@github.com>2023-08-31 20:16:01 +0200
commit02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33 (patch)
tree66f6d6f089a93b863bf1144666491eca6729ad05 /plugins/base/src/main/kotlin/generation
parent6a181a7a2b03ec263788d137610e86937a57d434 (diff)
downloaddokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.gz
dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.bz2
dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.zip
Enable explicit API mode (#3139)
Diffstat (limited to 'plugins/base/src/main/kotlin/generation')
-rw-r--r--plugins/base/src/main/kotlin/generation/SingleModuleGeneration.kt28
1 files changed, 15 insertions, 13 deletions
diff --git a/plugins/base/src/main/kotlin/generation/SingleModuleGeneration.kt b/plugins/base/src/main/kotlin/generation/SingleModuleGeneration.kt
index b99afb3d..602173f4 100644
--- a/plugins/base/src/main/kotlin/generation/SingleModuleGeneration.kt
+++ b/plugins/base/src/main/kotlin/generation/SingleModuleGeneration.kt
@@ -22,7 +22,7 @@ import org.jetbrains.dokka.transformers.sources.AsyncSourceToDocumentableTransla
import org.jetbrains.dokka.utilities.parallelMap
import org.jetbrains.dokka.utilities.report
-class SingleModuleGeneration(private val context: DokkaContext) : Generation {
+public class SingleModuleGeneration(private val context: DokkaContext) : Generation {
override fun Timer.generate() {
report("Validity check")
@@ -59,38 +59,40 @@ class SingleModuleGeneration(private val context: DokkaContext) : Generation {
reportAfterRendering()
}
- override val generationName = "documentation for ${context.configuration.moduleName}"
+ override val generationName: String = "documentation for ${context.configuration.moduleName}"
- fun createDocumentationModels(): List<DModule> = runBlocking(Dispatchers.Default) {
+ public fun createDocumentationModels(): List<DModule> = runBlocking(Dispatchers.Default) {
context.configuration.sourceSets.parallelMap { sourceSet -> translateSources(sourceSet, context) }.flatten()
.also { modules -> if (modules.isEmpty()) exitGenerationGracefully("Nothing to document") }
}
- fun transformDocumentationModelBeforeMerge(modulesFromPlatforms: List<DModule>) =
- context.plugin<DokkaBase>().query { preMergeDocumentableTransformer }
+ public fun transformDocumentationModelBeforeMerge(modulesFromPlatforms: List<DModule>): List<DModule> {
+ return context.plugin<DokkaBase>()
+ .query { preMergeDocumentableTransformer }
.fold(modulesFromPlatforms) { acc, t -> t(acc) }
+ }
- fun mergeDocumentationModels(modulesFromPlatforms: List<DModule>) =
+ public fun mergeDocumentationModels(modulesFromPlatforms: List<DModule>): DModule? =
context.single(CoreExtensions.documentableMerger).invoke(modulesFromPlatforms)
- fun transformDocumentationModelAfterMerge(documentationModel: DModule) =
+ public fun transformDocumentationModelAfterMerge(documentationModel: DModule): DModule =
context[CoreExtensions.documentableTransformer].fold(documentationModel) { acc, t -> t(acc, context) }
- fun createPages(transformedDocumentation: DModule): RootPageNode =
+ public fun createPages(transformedDocumentation: DModule): RootPageNode =
context.single(CoreExtensions.documentableToPageTranslator).invoke(transformedDocumentation)
- fun transformPages(pages: RootPageNode): RootPageNode =
+ public fun transformPages(pages: RootPageNode): RootPageNode =
context[CoreExtensions.pageTransformer].fold(pages) { acc, t -> t(acc) }
- fun render(transformedPages: RootPageNode) {
+ public fun render(transformedPages: RootPageNode) {
context.single(CoreExtensions.renderer).render(transformedPages)
}
- fun runPostActions() {
+ public fun runPostActions() {
context[CoreExtensions.postActions].forEach { it() }
}
- fun validityCheck(context: DokkaContext) {
+ public fun validityCheck(context: DokkaContext) {
val (preGenerationCheckResult, checkMessages) = context[CoreExtensions.preGenerationCheck].fold(
Pair(true, emptyList<String>())
) { acc, checker -> checker() + acc }
@@ -99,7 +101,7 @@ class SingleModuleGeneration(private val context: DokkaContext) : Generation {
)
}
- fun reportAfterRendering() {
+ public fun reportAfterRendering() {
context.unusedPoints.takeIf { it.isNotEmpty() }?.also {
context.logger.info("Unused extension points found: ${it.joinToString(", ")}")
}