aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt2
-rw-r--r--plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt2
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt4
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt8
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt8
-rw-r--r--plugins/base/test-utils/src/main/kotlin/renderers/defaultSourceSet.kt14
-rw-r--r--plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt7
-rw-r--r--plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt10
-rw-r--r--plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt2
9 files changed, 27 insertions, 30 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
)
diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt
index 2381ad07..cd9b9dfc 100644
--- a/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt
+++ b/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt
@@ -2,7 +2,6 @@ package renderers.gfm
import org.jetbrains.dokka.DokkaSourceSetID
import org.jetbrains.dokka.Platform
-import org.jetbrains.dokka.SourceRootImpl
import org.jetbrains.dokka.gfm.CommonmarkRenderer
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.pages.ContentDivergentGroup
@@ -17,21 +16,21 @@ class DivergentTest : GfmRenderingOnlyTestBase() {
"js",
DokkaSourceSetID("root", "js"),
analysisPlatform = Platform.js,
- sourceRoots = listOf(SourceRootImpl("pl1"))
+ sourceRoots = setOf(File("pl1"))
)
private val jvm = defaultSourceSet.copy(
"root",
"jvm",
DokkaSourceSetID("root", "jvm"),
analysisPlatform = Platform.jvm,
- sourceRoots = listOf(SourceRootImpl("pl1"))
+ sourceRoots = setOf(File("pl1"))
)
private val native = defaultSourceSet.copy(
"root",
"native",
DokkaSourceSetID("root", "native"),
analysisPlatform = Platform.native,
- sourceRoots = listOf(SourceRootImpl("pl1"))
+ sourceRoots = setOf(File("pl1"))
)
@Test
diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt
index e181e3a2..de473db0 100644
--- a/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt
+++ b/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt
@@ -2,12 +2,12 @@ package renderers.gfm
import org.jetbrains.dokka.DokkaSourceSetID
import org.jetbrains.dokka.Platform
-import org.jetbrains.dokka.SourceRootImpl
import org.jetbrains.dokka.gfm.CommonmarkRenderer
import org.jetbrains.dokka.pages.TextStyle
import org.junit.jupiter.api.Test
import renderers.TestPage
import renderers.defaultSourceSet
+import java.io.File
class SourceSetDependentHintTest : GfmRenderingOnlyTestBase() {
@@ -16,21 +16,21 @@ class SourceSetDependentHintTest : GfmRenderingOnlyTestBase() {
"pl1",
DokkaSourceSetID("root", "pl1"),
analysisPlatform = Platform.js,
- sourceRoots = listOf(SourceRootImpl("pl1"))
+ sourceRoots = setOf(File("pl1"))
)
private val pl2 = defaultSourceSet.copy(
"root",
"pl2",
DokkaSourceSetID("root", "pl2"),
analysisPlatform = Platform.jvm,
- sourceRoots = listOf(SourceRootImpl("pl1"))
+ sourceRoots = setOf(File("pl1"))
)
private val pl3 = defaultSourceSet.copy(
"root",
"pl3",
DokkaSourceSetID("root", "pl3"),
analysisPlatform = Platform.native,
- sourceRoots = listOf(SourceRootImpl("pl1"))
+ sourceRoots = setOf(File("pl1"))
)
@Test
@@ -134,4 +134,4 @@ class SourceSetDependentHintTest : GfmRenderingOnlyTestBase() {
CommonmarkRenderer(context).render(page)
assert(renderedContent == "//[testPage](test-page.md)\n\n [pl1, pl2] a \n \n [pl3] b \n \n")
}
-} \ No newline at end of file
+}
diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt
index 89d5b286..aa5013e5 100644
--- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt
+++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt
@@ -110,7 +110,7 @@ internal class JavadocPackageTemplateMapTest : AbstractJavadocTemplateMapTest()
configuration = config.copy(
sourceSets = config.sourceSets.map { sourceSet ->
sourceSet.copy(
- includes = listOf(File("packages.md"))
+ includes = setOf(File("packages.md"))
)
}
)