diff options
Diffstat (limited to 'plugins/base')
6 files changed, 18 insertions, 20 deletions
diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 1ac4edf7..383a3715 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -95,7 +95,7 @@ private class DokkaDescriptorVisitor( private fun Collection<DeclarationDescriptor>.filterDescriptorsInSourceSet() = filter { it.toSourceElement.containingFile.toString().let { path -> path.isNotBlank() && sourceSet.sourceRoots.any { root -> - Paths.get(path).startsWith(root.directory.toPath()) + Paths.get(path).startsWith(root.toPath()) } } } diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index cd43e635..71c19bbe 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -44,7 +44,7 @@ class DefaultPsiToDocumentableTranslator( override fun invoke(sourceSet: DokkaSourceSet, context: DokkaContext): DModule { fun isFileInSourceRoots(file: File): Boolean { - return sourceSet.sourceRoots.any { root -> file.startsWith(root.directory) } + return sourceSet.sourceRoots.any { root -> file.startsWith(root) } } val (environment, _) = kotlinAnalysis[sourceSet] diff --git a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt index 8ab277f1..b4de5aed 100644 --- a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt @@ -1,12 +1,10 @@ package renderers.html -import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.SourceRootImpl import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.pages.ContentDivergentGroup import org.junit.jupiter.api.Test -import renderers.* +import renderers.TestPage import utils.Div import utils.Span import utils.match diff --git a/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt b/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt index ae494929..eea4dc0c 100644 --- a/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt +++ b/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt @@ -2,7 +2,6 @@ package renderers.html import org.jetbrains.dokka.DokkaConfigurationImpl import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.SourceRootImpl import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.DefaultTabSortingStrategy import org.jetbrains.dokka.base.renderers.RootCreator @@ -17,6 +16,7 @@ import org.jsoup.nodes.TextNode import renderers.RenderingOnlyTestBase import utils.TestOutputWriter import renderers.defaultSourceSet +import java.io.File abstract class HtmlRenderingOnlyTestBase : RenderingOnlyTestBase<Element>() { @@ -25,7 +25,7 @@ abstract class HtmlRenderingOnlyTestBase : RenderingOnlyTestBase<Element>() { "JS", defaultSourceSet.sourceSetID.copy(sourceSetName = "js"), analysisPlatform = Platform.js, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) protected val jvm = defaultSourceSet.copy( "root", @@ -33,14 +33,14 @@ abstract class HtmlRenderingOnlyTestBase : RenderingOnlyTestBase<Element>() { defaultSourceSet.sourceSetID.copy(sourceSetName = "jvm"), analysisPlatform = Platform.jvm, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) protected val native = defaultSourceSet.copy( "root", "NATIVE", defaultSourceSet.sourceSetID.copy(sourceSetName = "native"), analysisPlatform = Platform.native, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) val files = TestOutputWriter() diff --git a/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt b/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt index cf7f47e6..77ba390e 100644 --- a/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt @@ -1,7 +1,6 @@ package renderers.html import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.SourceRootImpl import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.pages.TextStyle import org.junit.jupiter.api.Test @@ -10,6 +9,7 @@ import renderers.defaultSourceSet import renderers.RenderingOnlyTestBase import utils.Div import utils.match +import java.io.File class SourceSetDependentHintTest : HtmlRenderingOnlyTestBase() { @@ -18,21 +18,21 @@ class SourceSetDependentHintTest : HtmlRenderingOnlyTestBase() { "pl1", defaultSourceSet.sourceSetID.copy(sourceSetName = "pl1"), analysisPlatform = Platform.js, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) private val pl2 = defaultSourceSet.copy( "root", "pl2", defaultSourceSet.sourceSetID.copy(sourceSetName = "pl2"), analysisPlatform = Platform.jvm, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) private val pl3 = defaultSourceSet.copy( "root", "pl3", defaultSourceSet.sourceSetID.copy(sourceSetName = "pl3"), analysisPlatform = Platform.native, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) @Test diff --git a/plugins/base/test-utils/src/main/kotlin/renderers/defaultSourceSet.kt b/plugins/base/test-utils/src/main/kotlin/renderers/defaultSourceSet.kt index 7358d2c2..8d19870c 100644 --- a/plugins/base/test-utils/src/main/kotlin/renderers/defaultSourceSet.kt +++ b/plugins/base/test-utils/src/main/kotlin/renderers/defaultSourceSet.kt @@ -8,24 +8,24 @@ val defaultSourceSet = DokkaSourceSetImpl( moduleDisplayName = "DEFAULT", displayName = "DEFAULT", sourceSetID = DokkaSourceSetID("DEFAULT", "DEFAULT"), - classpath = emptyList(), - sourceRoots = emptyList(), + classpath = emptySet(), + sourceRoots = emptySet(), dependentSourceSets = emptySet(), - samples = emptyList(), - includes = emptyList(), + samples = emptySet(), + includes = emptySet(), includeNonPublic = false, includeRootPackage = false, reportUndocumented = false, skipEmptyPackages = true, skipDeprecated = false, jdkVersion = 8, - sourceLinks = emptyList(), + sourceLinks = emptySet(), perPackageOptions = emptyList(), - externalDocumentationLinks = emptyList(), + externalDocumentationLinks = emptySet(), languageVersion = null, apiVersion = null, noStdlibLink = false, noJdkLink = false, - suppressedFiles = emptyList(), + suppressedFiles = emptySet(), analysisPlatform = Platform.DEFAULT ) |