aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/main/kotlin')
-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()
+ )
}
}