diff options
| author | Marcin Aman <marcin.aman@gmail.com> | 2021-01-21 00:34:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-21 00:34:43 +0100 |
| commit | fdf8a298f586d7e334c312346b70b59c64c8d037 (patch) | |
| tree | d9e92e920c24f442df6339e19b27225d7d01d21b /plugins/base/src/main/kotlin/generation | |
| parent | 1f592a7ec2786e0a0b77d224d1414ef3042caae4 (diff) | |
| download | dokka-fdf8a298f586d7e334c312346b70b59c64c8d037.tar.gz dokka-fdf8a298f586d7e334c312346b70b59c64c8d037.tar.bz2 dokka-fdf8a298f586d7e334c312346b70b59c64c8d037.zip | |
Empty modules filtering (#1699)
Diffstat (limited to 'plugins/base/src/main/kotlin/generation')
| -rw-r--r-- | plugins/base/src/main/kotlin/generation/SingleModuleGeneration.kt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/base/src/main/kotlin/generation/SingleModuleGeneration.kt b/plugins/base/src/main/kotlin/generation/SingleModuleGeneration.kt index 1689a1dd..9bf61af9 100644 --- a/plugins/base/src/main/kotlin/generation/SingleModuleGeneration.kt +++ b/plugins/base/src/main/kotlin/generation/SingleModuleGeneration.kt @@ -1,4 +1,3 @@ - package org.jetbrains.dokka.base.generation import kotlinx.coroutines.Dispatchers @@ -32,6 +31,7 @@ class SingleModuleGeneration(private val context: DokkaContext) : Generation { report("Merging documentation models") val documentationModel = mergeDocumentationModels(transformedDocumentationBeforeMerge) + ?: exitGenerationGracefully("Nothing to document") report("Transforming documentation model after merging") val transformedDocumentation = transformDocumentationModelAfterMerge(documentationModel) @@ -56,7 +56,8 @@ class SingleModuleGeneration(private val context: DokkaContext) : Generation { } fun transformDocumentationModelBeforeMerge(modulesFromPlatforms: List<DModule>) = - context.plugin<DokkaBase>().query { preMergeDocumentableTransformer }.fold(modulesFromPlatforms) { acc, t -> t(acc) } + context.plugin<DokkaBase>().query { preMergeDocumentableTransformer } + .fold(modulesFromPlatforms) { acc, t -> t(acc) } fun mergeDocumentationModels(modulesFromPlatforms: List<DModule>) = context.single(CoreExtensions.documentableMerger).invoke(modulesFromPlatforms) @@ -99,7 +100,7 @@ class SingleModuleGeneration(private val context: DokkaContext) : Generation { private suspend fun translateSources(sourceSet: DokkaConfiguration.DokkaSourceSet, context: DokkaContext) = context[CoreExtensions.sourceToDocumentableTranslator].parallelMap { translator -> - when(translator){ + when (translator) { is AsyncSourceToDocumentableTranslator -> translator.invokeSuspending(sourceSet, context) else -> translator.invoke(sourceSet, context) } |
