diff options
-rw-r--r-- | plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt | 3 | ||||
-rw-r--r-- | testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt | 5 |
2 files changed, 7 insertions, 1 deletions
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) diff --git a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt index 333642b1..a23c2713 100644 --- a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt +++ b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt @@ -72,6 +72,11 @@ abstract class AbstractCoreTest( }.toSet(), suppressedFiles = sourceSet.suppressedFiles.map { file -> testDirPath.toFile().resolve(file) + }.toSet(), + sourceLinks = sourceSet.sourceLinks.map { link -> + link.copy( + localDirectory = testDirPath.toFile().resolve(link.localDirectory).canonicalPath + ) }.toSet() ) } |