diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-06-19 14:08:49 +0200 |
---|---|---|
committer | Paweł Marks <pmarks@virtuslab.com> | 2020-06-25 20:23:58 +0200 |
commit | 8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f (patch) | |
tree | fe4e24d9f352199e551bd34ba330c0d2c0acf7af /testApi | |
parent | 08f40e2a13006882e8f8425f111b8527e7bbcb0f (diff) | |
download | dokka-8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f.tar.gz dokka-8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f.tar.bz2 dokka-8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f.zip |
Remove SourceSetDataCache, rename PassConfiguration to DokkaSourceSet and use it instead of SourceSetData
Diffstat (limited to 'testApi')
3 files changed, 15 insertions, 21 deletions
diff --git a/testApi/src/main/kotlin/testApi/context/MockContext.kt b/testApi/src/main/kotlin/testApi/context/MockContext.kt index e3da5f68..07aedf28 100644 --- a/testApi/src/main/kotlin/testApi/context/MockContext.kt +++ b/testApi/src/main/kotlin/testApi/context/MockContext.kt @@ -1,8 +1,7 @@ package org.jetbrains.dokka.testApi.context import org.jetbrains.dokka.DokkaConfiguration -import org.jetbrains.dokka.model.SourceSetCache -import org.jetbrains.dokka.model.SourceSetData +import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.plugability.ExtensionPoint @@ -15,8 +14,7 @@ import kotlin.reflect.full.memberProperties class MockContext( vararg extensions: Pair<ExtensionPoint<*>, (DokkaContext) -> Any>, private val testConfiguration: DokkaConfiguration? = null, - private val unusedExtensionPoints: List<ExtensionPoint<*>>? = null, - override val sourceSetCache: SourceSetCache + private val unusedExtensionPoints: List<ExtensionPoint<*>>? = null ) : DokkaContext { private val extensionMap by lazy { extensions.groupBy(Pair<ExtensionPoint<*>, (DokkaContext) -> Any>::first) { diff --git a/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt b/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt index 7248a4cb..ec2be689 100644 --- a/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt +++ b/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt @@ -1,9 +1,8 @@ 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.model.SourceSetCache -import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.utilities.DokkaLogger @@ -16,13 +15,12 @@ internal class DokkaTestGenerator( fun generate() = with(testMethods) { val dokkaGenerator = DokkaGenerator(configuration, logger) - val sourceSetsCache = SourceSetCache() val context = - dokkaGenerator.initializePlugins(configuration, logger, sourceSetsCache, pluginOverrides) + dokkaGenerator.initializePlugins(configuration, logger, pluginOverrides) pluginsSetupStage(context) - val modulesFromPlatforms = dokkaGenerator.createDocumentationModels(context, sourceSetsCache) + val modulesFromPlatforms = dokkaGenerator.createDocumentationModels(context) documentablesCreationStage(modulesFromPlatforms) val filteredModules = dokkaGenerator.transformDocumentationModelBeforeMerge(modulesFromPlatforms, context) diff --git a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt index 88595f85..624ea914 100644 --- a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt +++ b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt @@ -3,13 +3,11 @@ package org.jetbrains.dokka.testApi.testRunner import com.intellij.openapi.application.PathManager import org.jetbrains.dokka.* import org.jetbrains.dokka.model.DModule -import org.jetbrains.dokka.model.SourceSetData -import org.jetbrains.dokka.pages.ModulePageNode +import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.utilities.DokkaConsoleLogger -import org.jetbrains.dokka.utilities.DokkaLogger import org.junit.rules.TemporaryFolder import testApi.logger.TestLogger import java.io.File @@ -66,7 +64,7 @@ abstract class AbstractCoreTest { val newConfiguration = configuration.copy( outputDir = testDirPath.toAbsolutePath().toString(), - passesConfigurations = configuration.passesConfigurations.map { + sourceSets = configuration.sourceSets.map { it.copy(sourceRoots = it.sourceRoots.map { it.copy(path = "${testDirPath.toAbsolutePath()}/${it.path}") }) } ) @@ -143,13 +141,13 @@ abstract class AbstractCoreTest { var pluginsClasspath: List<File> = emptyList() var pluginsConfigurations: Map<String, String> = emptyMap() var failOnWarning: Boolean = false - private val passesConfigurations = mutableListOf<PassConfigurationImpl>() + private val sourceSets = mutableListOf<DokkaSourceSetImpl>() fun build() = DokkaConfigurationImpl( outputDir = outputDir, format = format, cacheRoot = cacheRoot, offlineMode = offlineMode, - passesConfigurations = passesConfigurations, + sourceSets = sourceSets, pluginsClasspath = pluginsClasspath, pluginsConfiguration = pluginsConfigurations, modules = emptyList(), @@ -157,18 +155,18 @@ abstract class AbstractCoreTest { ) fun passes(block: Passes.() -> Unit) { - passesConfigurations.addAll(Passes().apply(block)) + sourceSets.addAll(Passes().apply(block)) } } @DokkaConfigurationDsl - protected class Passes : ArrayList<PassConfigurationImpl>() { - fun pass(block: DokkaPassConfigurationBuilder.() -> Unit) = - add(DokkaPassConfigurationBuilder().apply(block).build()) + protected class Passes : ArrayList<DokkaSourceSetImpl>() { + fun pass(block: DokkaSourceSetBuilder.() -> Unit) = + add(DokkaSourceSetBuilder().apply(block).build()) } @DokkaConfigurationDsl - protected class DokkaPassConfigurationBuilder( + protected class DokkaSourceSetBuilder( var moduleName: String = "root", var sourceSetID: String = "main", var displayName: String = "JVM", @@ -193,7 +191,7 @@ abstract class AbstractCoreTest { var externalDocumentationLinks: List<ExternalDocumentationLinkImpl> = emptyList(), var sourceLinks: List<SourceLinkDefinitionImpl> = emptyList() ) { - fun build() = PassConfigurationImpl( + fun build() = DokkaSourceSetImpl( moduleName = moduleName, displayName = displayName, sourceSetID = sourceSetID, |