From ad1e4c2833abcc78d7a795b4ec4ac50ebf17520b Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Fri, 21 Aug 2020 15:59:58 +0200 Subject: SourceLinksTransformer: Use java.io.File to match source files --- .../kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/base/src/main/kotlin/transformers/pages/sourcelinks') diff --git a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt index 8eb7208b..13f70603 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt @@ -16,6 +16,7 @@ import org.jetbrains.dokka.transformers.pages.PageTransformer import org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithSource import org.jetbrains.kotlin.resolve.source.getPsi import org.jetbrains.kotlin.utils.addToStdlib.cast +import java.io.File class SourceLinksTransformer(val context: DokkaContext, val builder: PageContentBuilder) : PageTransformer { @@ -35,7 +36,7 @@ class SourceLinksTransformer(val context: DokkaContext, val builder: PageContent private fun resolveSources(documentable: WithExpectActual) = documentable.sources .mapNotNull { entry -> - getSourceLinks().find { entry.value.path.contains(it.path) && it.sourceSetData == entry.key }?.let { + getSourceLinks().find { File(entry.value.path).startsWith(it.path) && it.sourceSetData == entry.key }?.let { Pair( entry.key, entry.value.toLink(it) -- cgit