aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-07-18 12:18:59 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-14 17:51:11 +0200
commiteae1ce49d18c2978b49166ea502bf2c109a85504 (patch)
tree477f39e33f14c71042f06eecc938d6efaa95e66c /plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt
parent6c635551ed3ea0cfe5f04b54a98cb28225061d26 (diff)
downloaddokka-eae1ce49d18c2978b49166ea502bf2c109a85504.tar.gz
dokka-eae1ce49d18c2978b49166ea502bf2c109a85504.tar.bz2
dokka-eae1ce49d18c2978b49166ea502bf2c109a85504.zip
Simplify Dokka Gradle Plugin
Diffstat (limited to 'plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt')
-rw-r--r--plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt7
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt b/plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt
index de2242f2..4be84749 100644
--- a/plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt
+++ b/plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt
@@ -43,7 +43,7 @@ class MultimodulePageCreator(
header(2, "All modules:")
table(styles = setOf(MultimoduleTable)) {
modules.mapNotNull { module ->
- val paragraph = module.docFile.let(::File).readText().let { parser.parse(it).firstParagraph() }
+ val paragraph = module.docFile.readText().let { parser.parse(it).firstParagraph() }
paragraph?.let {
val dri = DRI(packageName = MULTIMODULE_PACKAGE_PLACEHOLDER, classNames = module.name)
val dci = DCI(setOf(dri), ContentKind.Main)
@@ -68,10 +68,9 @@ class MultimodulePageCreator(
}
private fun throwOnMissingModuleDocFile(module: DokkaConfiguration.DokkaModuleDescription) {
- val docFile = File(module.docFile)
- if (!docFile.exists() || !docFile.isFile) {
+ if (!module.docFile.exists() || !module.docFile.isFile) {
throw DokkaException(
- "Missing documentation file for module ${module.name}: ${docFile.absolutePath}"
+ "Missing documentation file for module ${module.name}: ${module.docFile.absolutePath}"
)
}
}