aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/transformers
diff options
context:
space:
mode:
authorSzymon Świstun <sswistun@virtuslab.com>2019-12-17 17:13:25 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-01-08 10:45:08 +0100
commita0a5fc5e362c38ee0592ce5332bbec02131ebbd2 (patch)
treeb4f5ab63d6f32ae318d2badbe9249a93104b2e79 /core/src/main/kotlin/transformers
parentfc1baea0b6c44ebc84a33918c3dfa13244ebf46f (diff)
downloaddokka-a0a5fc5e362c38ee0592ce5332bbec02131ebbd2.tar.gz
dokka-a0a5fc5e362c38ee0592ce5332bbec02131ebbd2.tar.bz2
dokka-a0a5fc5e362c38ee0592ce5332bbec02131ebbd2.zip
module name fix
Diffstat (limited to 'core/src/main/kotlin/transformers')
-rw-r--r--core/src/main/kotlin/transformers/documentation/DefaultDocumentationNodeMerger.kt9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/src/main/kotlin/transformers/documentation/DefaultDocumentationNodeMerger.kt b/core/src/main/kotlin/transformers/documentation/DefaultDocumentationNodeMerger.kt
index fe689c01..626038f5 100644
--- a/core/src/main/kotlin/transformers/documentation/DefaultDocumentationNodeMerger.kt
+++ b/core/src/main/kotlin/transformers/documentation/DefaultDocumentationNodeMerger.kt
@@ -1,18 +1,23 @@
package org.jetbrains.dokka.transformers.documentation
+import com.intellij.openapi.diagnostic.logger
import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.model.Function
import org.jetbrains.dokka.plugability.DokkaContext
+import org.jetbrains.dokka.utilities.DokkaConsoleLogger
internal object DefaultDocumentationNodeMerger : DocumentationNodeMerger {
- override fun invoke(modules: Collection<Module>, context: DokkaContext): Module =
- Module(
+ override fun invoke(modules: Collection<Module>, context: DokkaContext): Module {
+ if (!modules.drop(1).all { it.name == modules.first().name })
+ DokkaConsoleLogger.error("All module names need to be the same")
+ return Module(
modules.first().name,
merge(
modules.flatMap { it.packages },
Package::mergeWith
)
)
+ }
}
private fun <T: Documentable> merge(elements: List<T>, reducer: (T, T) -> T): List<T> =