diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-06-30 23:06:03 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-07-06 17:59:15 +0200 |
commit | b0e8622f374f6499058b0f083367b4a54512b702 (patch) | |
tree | 0fa641dc26bf1e7ed6497ee2340999e8ecc505ad /testApi/src/main | |
parent | b0b418334535adc60ee80c3df1b2293dfcaad071 (diff) | |
download | dokka-b0e8622f374f6499058b0f083367b4a54512b702.tar.gz dokka-b0e8622f374f6499058b0f083367b4a54512b702.tar.bz2 dokka-b0e8622f374f6499058b0f083367b4a54512b702.zip |
Enforce workspace unique SourceSetID
Diffstat (limited to 'testApi/src/main')
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, |