aboutsummaryrefslogtreecommitdiff
path: root/core/test-api/src
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-08-28 18:24:11 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-31 15:10:04 +0200
commit8bae1b84fabce1eae68a6bd9464c5a13a03b36d4 (patch)
treeec222e6375f7282566b4770ae06fce76b529c174 /core/test-api/src
parentc75185e229c7e8bf8e2d894d08d1d0159cd60094 (diff)
downloaddokka-8bae1b84fabce1eae68a6bd9464c5a13a03b36d4.tar.gz
dokka-8bae1b84fabce1eae68a6bd9464c5a13a03b36d4.tar.bz2
dokka-8bae1b84fabce1eae68a6bd9464c5a13a03b36d4.zip
Implement dPackage and dModule test APIs in favour of default params in DModule and DPackage
Diffstat (limited to 'core/test-api/src')
-rw-r--r--core/test-api/src/main/kotlin/testApi/testRunner/TestDokkaConfigurationBuilder.kt39
1 files changed, 39 insertions, 0 deletions
diff --git a/core/test-api/src/main/kotlin/testApi/testRunner/TestDokkaConfigurationBuilder.kt b/core/test-api/src/main/kotlin/testApi/testRunner/TestDokkaConfigurationBuilder.kt
index 2d9f99b2..d7b4f64f 100644
--- a/core/test-api/src/main/kotlin/testApi/testRunner/TestDokkaConfigurationBuilder.kt
+++ b/core/test-api/src/main/kotlin/testApi/testRunner/TestDokkaConfigurationBuilder.kt
@@ -6,6 +6,7 @@ import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.model.doc.Description
import org.jetbrains.dokka.model.doc.DocumentationNode
import org.jetbrains.dokka.model.doc.Text
+import org.jetbrains.dokka.model.properties.PropertyContainer
import java.io.File
fun dokkaConfiguration(block: TestDokkaConfigurationBuilder.() -> Unit): DokkaConfigurationImpl =
@@ -145,6 +146,44 @@ fun sourceSet(name: String): DokkaConfiguration.DokkaSourceSet {
)
}
+fun dModule(
+ name: String,
+ packages: List<DPackage> = emptyList(),
+ documentation: SourceSetDependent<DocumentationNode> = emptyMap(),
+ expectPresentInSet: DokkaConfiguration.DokkaSourceSet? = null,
+ sourceSets: Set<DokkaConfiguration.DokkaSourceSet> = emptySet(),
+ extra: PropertyContainer<DModule> = PropertyContainer.empty()
+): DModule = DModule(
+ name = name,
+ packages = packages,
+ documentation = documentation,
+ expectPresentInSet = expectPresentInSet,
+ sourceSets = sourceSets,
+ extra = extra
+)
+
+fun dPackage(
+ dri: DRI,
+ functions: List<DFunction> = emptyList(),
+ properties: List<DProperty> = emptyList(),
+ classlikes: List<DClasslike> = emptyList(),
+ typealiases: List<DTypeAlias> = emptyList(),
+ documentation: SourceSetDependent<DocumentationNode> = emptyMap(),
+ expectPresentInSet: DokkaConfiguration.DokkaSourceSet? = null,
+ sourceSets: Set<DokkaConfiguration.DokkaSourceSet> = emptySet(),
+ extra: PropertyContainer<DPackage> = PropertyContainer.empty()
+): DPackage = DPackage(
+ dri = dri,
+ functions = functions,
+ properties = properties,
+ classlikes = classlikes,
+ typealiases = typealiases,
+ documentation = documentation,
+ expectPresentInSet = expectPresentInSet,
+ sourceSets = sourceSets,
+ extra = extra
+)
+
fun documentationNode(vararg texts: String): DocumentationNode {
return DocumentationNode(texts.toList().map { Description(Text(it)) })
}