aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-08-26 11:47:49 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-31 15:10:04 +0200
commitee13af00483887fb6cfdde10a58cbb43542cf2d7 (patch)
treef8af0819f34e4188e3d3800b818efb864e623068 /plugins/base/src/main
parent8d25036f5b919e9d3acc8907e70e965330efae82 (diff)
downloaddokka-ee13af00483887fb6cfdde10a58cbb43542cf2d7.tar.gz
dokka-ee13af00483887fb6cfdde10a58cbb43542cf2d7.tar.bz2
dokka-ee13af00483887fb6cfdde10a58cbb43542cf2d7.zip
Implement tests for ModuleAndPackageDocumentationReader
Diffstat (limited to 'plugins/base/src/main')
-rw-r--r--plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationReader.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationReader.kt b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationReader.kt
index e8297f3f..4900e9a8 100644
--- a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationReader.kt
+++ b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationReader.kt
@@ -21,7 +21,6 @@ internal interface ModuleAndPackageDocumentationReader {
operator fun get(pkg: DPackage): SourceSetDependent<DocumentationNode>
}
-// TODO NOW: Test
internal fun ModuleAndPackageDocumentationReader(
context: DokkaContext, kotlinAnalysis: KotlinAnalysis? = null
): ModuleAndPackageDocumentationReader = ContextModuleAndPackageDocumentationReader(context, kotlinAnalysis)
@@ -59,7 +58,11 @@ private class ContextModuleAndPackageDocumentationReader(
override fun get(module: DModule): SourceSetDependent<DocumentationNode> {
return findDocumentationNodes(module.sourceSets) { fragment ->
- fragment.classifier == Classifier.Module && fragment.name == module.name
+ fragment.classifier == Classifier.Module && (
+ /* Match fragment name against module name or distinct module displayName */
+ fragment.name == module.name ||
+ fragment.name == module.sourceSets.map { it.moduleDisplayName }.distinct().singleOrNull()
+ )
}
}