diff options
Diffstat (limited to 'testApi/src')
3 files changed, 12 insertions, 13 deletions
diff --git a/testApi/src/main/kotlin/testApi/context/MockContext.kt b/testApi/src/main/kotlin/testApi/context/MockContext.kt index 07aedf28..97347695 100644 --- a/testApi/src/main/kotlin/testApi/context/MockContext.kt +++ b/testApi/src/main/kotlin/testApi/context/MockContext.kt @@ -1,7 +1,6 @@ package org.jetbrains.dokka.testApi.context import org.jetbrains.dokka.DokkaConfiguration -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.plugability.ExtensionPoint @@ -45,4 +44,4 @@ class MockContext( private fun DokkaPlugin.injectContext(context: DokkaContext) { (DokkaPlugin::class.memberProperties.single { it.name == "context" } as KMutableProperty<*>) .setter.call(this, context) -}
\ No newline at end of file +} diff --git a/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt b/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt index ec2be689..d3127263 100644 --- a/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt +++ b/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt @@ -1,7 +1,6 @@ package org.jetbrains.dokka.testApi.testRunner import org.jetbrains.dokka.DokkaConfiguration -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.DokkaGenerator import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.utilities.DokkaLogger @@ -43,4 +42,4 @@ internal class DokkaTestGenerator( dokkaGenerator.reportAfterRendering(context) } -}
\ No newline at end of file +} diff --git a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt index 057045a8..381fb2af 100644 --- a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt +++ b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt @@ -174,25 +174,26 @@ abstract class AbstractCoreTest { failOnWarning = failOnWarning ) - fun passes(block: Passes.() -> Unit) { - sourceSets.addAll(Passes().apply(block)) + fun sourceSets(block: SourceSetsBuilder.() -> Unit) { + sourceSets.addAll(SourceSetsBuilder().apply(block)) } } @DokkaConfigurationDsl - protected class Passes : ArrayList<DokkaSourceSetImpl>() { - fun pass(block: DokkaSourceSetBuilder.() -> Unit) = - add(DokkaSourceSetBuilder().apply(block).build()) + protected class SourceSetsBuilder : ArrayList<DokkaSourceSetImpl>() { + fun sourceSet(block: DokkaSourceSetBuilder.() -> Unit): DokkaSourceSet = + DokkaSourceSetBuilder().apply(block).build().apply(::add) } @DokkaConfigurationDsl protected class DokkaSourceSetBuilder( var moduleName: String = "root", - var sourceSetID: String = "main", + var moduleDisplayName: String? = null, + var name: String = "main", var displayName: String = "JVM", var classpath: List<String> = emptyList(), var sourceRoots: List<String> = emptyList(), - var dependentSourceSets: List<String> = emptyList(), + var dependentSourceSets: Set<DokkaSourceSetID> = emptySet(), var samples: List<String> = emptyList(), var includes: List<String> = emptyList(), var includeNonPublic: Boolean = false, @@ -212,9 +213,9 @@ abstract class AbstractCoreTest { var sourceLinks: List<SourceLinkDefinitionImpl> = emptyList() ) { fun build() = DokkaSourceSetImpl( - moduleName = moduleName, + moduleDisplayName = moduleDisplayName ?: moduleName, displayName = displayName, - sourceSetID = sourceSetID, + sourceSetID = DokkaSourceSetID(moduleName, name), classpath = classpath, sourceRoots = sourceRoots.map { SourceRootImpl(it) }, dependentSourceSets = dependentSourceSets, |