aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-05-21 12:36:02 +0200
committerKamil Doległo <kamilok1965@interia.pl>2020-05-21 12:36:02 +0200
commitf5f46f972905c1cba2fe72042d0b210ac5d10885 (patch)
treed46b472fbb5c8609b8c125b841a6e8dd72ea4fc4 /plugins/base/src/main
parentbcab13e00238cb0a5936d082e895ba7a2743cee7 (diff)
downloaddokka-f5f46f972905c1cba2fe72042d0b210ac5d10885.tar.gz
dokka-f5f46f972905c1cba2fe72042d0b210ac5d10885.tar.bz2
dokka-f5f46f972905c1cba2fe72042d0b210ac5d10885.zip
Fix a bug with path filtering on Windows
Diffstat (limited to 'plugins/base/src/main')
-rw-r--r--plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
index a62d9a0b..f5b86df6 100644
--- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
+++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
@@ -35,6 +35,7 @@ import org.jetbrains.kotlin.resolve.source.KotlinSourceElement
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeProjection
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
+import java.nio.file.Paths
object DefaultDescriptorToDocumentableTranslator : SourceToDocumentableTranslator {
@@ -75,8 +76,11 @@ private class DokkaDescriptorVisitor(
}
private fun Collection<DeclarationDescriptor>.filterDescriptorsInSourceSet() = filter {
- val path = it.toSourceElement.containingFile.toString()
- path.isNotBlank() && sourceSet.sourceRoots.any { root -> path.startsWith(root.path) }
+ it.toSourceElement.containingFile.toString().let { path ->
+ path.isNotBlank() && sourceSet.sourceRoots.any { root ->
+ Paths.get(path).startsWith(Paths.get(root.path))
+ }
+ }
}
private fun <T> T.toSourceSetDependent() = mapOf(sourceSet to this)