aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt')
-rw-r--r--plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt14
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt b/plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt
index e3da9ecc..de2242f2 100644
--- a/plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt
+++ b/plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt
@@ -1,6 +1,8 @@
package org.jetbrains.dokka.base.allModulePage
+import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
+import org.jetbrains.dokka.DokkaException
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.resolvers.local.MultimoduleLocationProvider.Companion.MULTIMODULE_PACKAGE_PLACEHOLDER
import org.jetbrains.dokka.base.transformers.pages.comments.DocTagToContentConverter
@@ -24,6 +26,7 @@ class MultimodulePageCreator(
override fun invoke(): RootPageNode {
val parser = MarkdownParser(logger = logger)
val modules = context.configuration.modules
+ modules.forEach(::throwOnMissingModuleDocFile)
val commentsConverter = context.plugin(DokkaBase::class)?.querySingle { commentsToContentConverter }
val signatureProvider = context.plugin(DokkaBase::class)?.querySingle { signatureProvider }
@@ -64,6 +67,15 @@ class MultimodulePageCreator(
)
}
+ private fun throwOnMissingModuleDocFile(module: DokkaConfiguration.DokkaModuleDescription) {
+ val docFile = File(module.docFile)
+ if (!docFile.exists() || !docFile.isFile) {
+ throw DokkaException(
+ "Missing documentation file for module ${module.name}: ${docFile.absolutePath}"
+ )
+ }
+ }
+
private fun DocumentationNode.firstParagraph() =
this.children.flatMap { it.root.children }.filterIsInstance<P>().firstOrNull()
-} \ No newline at end of file
+}