aboutsummaryrefslogtreecommitdiff
path: root/plugins/base
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-08-12 08:19:26 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-08-12 09:38:06 +0200
commite783eefe0c3b124aa25fdb2b28b9f238d48e293b (patch)
tree0e09fad2c43c91cba40b8be2e0f62abab3d88347 /plugins/base
parentbbe5b00387da8fb8a54f8a8ecd80f2f2dea06830 (diff)
downloaddokka-e783eefe0c3b124aa25fdb2b28b9f238d48e293b.tar.gz
dokka-e783eefe0c3b124aa25fdb2b28b9f238d48e293b.tar.bz2
dokka-e783eefe0c3b124aa25fdb2b28b9f238d48e293b.zip
Move PreMergeDocumentableTransformer utils out of the interface
Diffstat (limited to 'plugins/base')
-rw-r--r--plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt3
-rw-r--r--plugins/base/src/main/kotlin/transformers/documentables/SuppressedDocumentableFilterTransformer.kt12
2 files changed, 8 insertions, 7 deletions
diff --git a/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt
index 2528b5f0..c901c9aa 100644
--- a/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt
+++ b/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt
@@ -3,6 +3,7 @@ package org.jetbrains.dokka.base.transformers.documentables
import org.jetbrains.dokka.model.DModule
import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer
+import org.jetbrains.dokka.transformers.documentation.sourceSet
class EmptyPackagesFilterTransformer(val context: DokkaContext) : PreMergeDocumentableTransformer {
override fun invoke(modules: List<DModule>): List<DModule> {
@@ -11,7 +12,7 @@ class EmptyPackagesFilterTransformer(val context: DokkaContext) : PreMergeDocume
private fun filterModule(module: DModule): DModule? {
val nonEmptyPackages = module.packages.filterNot { pkg ->
- pkg.sourceSet.skipEmptyPackages && pkg.children.isEmpty()
+ sourceSet(pkg).skipEmptyPackages && pkg.children.isEmpty()
}
return when {
diff --git a/plugins/base/src/main/kotlin/transformers/documentables/SuppressedDocumentableFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/SuppressedDocumentableFilterTransformer.kt
index f329e9ce..5a2818c7 100644
--- a/plugins/base/src/main/kotlin/transformers/documentables/SuppressedDocumentableFilterTransformer.kt
+++ b/plugins/base/src/main/kotlin/transformers/documentables/SuppressedDocumentableFilterTransformer.kt
@@ -1,10 +1,11 @@
package org.jetbrains.dokka.base.transformers.documentables
-import org.jetbrains.dokka.DokkaConfiguration
-import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer
+import org.jetbrains.dokka.transformers.documentation.perPackageOptions
+import org.jetbrains.dokka.transformers.documentation.source
+import org.jetbrains.dokka.transformers.documentation.sourceSet
import java.io.File
class SuppressedDocumentableFilterTransformer(val context: DokkaContext) : PreMergeDocumentableTransformer {
@@ -22,7 +23,7 @@ class SuppressedDocumentableFilterTransformer(val context: DokkaContext) : PreMe
}
private fun filterPackage(pkg: DPackage): DPackage? {
- val options = pkg.perPackageOptions
+ val options = perPackageOptions(pkg)
if (options?.suppress == true) {
return null
}
@@ -42,10 +43,9 @@ class SuppressedDocumentableFilterTransformer(val context: DokkaContext) : PreMe
private fun isSuppressed(documentable: Documentable): Boolean {
if (documentable !is WithExpectActual) return false
- val sourceFile = File(documentable.source.path).absoluteFile
- return documentable.sourceSet.suppressedFiles.any { suppressedFile ->
+ val sourceFile = File(source(documentable).path).absoluteFile
+ return sourceSet(documentable).suppressedFiles.any { suppressedFile ->
sourceFile.startsWith(File(suppressedFile).absoluteFile)
}
}
-
}