From 8bae1b84fabce1eae68a6bd9464c5a13a03b36d4 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Fri, 28 Aug 2020 18:24:11 +0200 Subject: Implement dPackage and dModule test APIs in favour of default params in DModule and DPackage --- .../testRunner/TestDokkaConfigurationBuilder.kt | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'core/test-api/src/main') 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 = emptyList(), + documentation: SourceSetDependent = emptyMap(), + expectPresentInSet: DokkaConfiguration.DokkaSourceSet? = null, + sourceSets: Set = emptySet(), + extra: PropertyContainer = PropertyContainer.empty() +): DModule = DModule( + name = name, + packages = packages, + documentation = documentation, + expectPresentInSet = expectPresentInSet, + sourceSets = sourceSets, + extra = extra +) + +fun dPackage( + dri: DRI, + functions: List = emptyList(), + properties: List = emptyList(), + classlikes: List = emptyList(), + typealiases: List = emptyList(), + documentation: SourceSetDependent = emptyMap(), + expectPresentInSet: DokkaConfiguration.DokkaSourceSet? = null, + sourceSets: Set = emptySet(), + extra: PropertyContainer = 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)) }) } -- cgit