aboutsummaryrefslogtreecommitdiff
path: root/testApi/src/main
diff options
context:
space:
mode:
authorSzymon Świstun <sswistun@virtuslab.com>2020-02-11 17:01:06 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-02-12 13:33:10 +0100
commit2a60f8adbab66e7b671949960c7cd90ea86992d7 (patch)
treef26363d9307886f240c185b939b2fe14ec6ef5bc /testApi/src/main
parentc5f9921bb5f6408be1d334f32167dcdc53a44286 (diff)
downloaddokka-2a60f8adbab66e7b671949960c7cd90ea86992d7.tar.gz
dokka-2a60f8adbab66e7b671949960c7cd90ea86992d7.tar.bz2
dokka-2a60f8adbab66e7b671949960c7cd90ea86992d7.zip
plugin overrides
Diffstat (limited to 'testApi/src/main')
-rw-r--r--testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt6
-rw-r--r--testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt7
2 files changed, 9 insertions, 4 deletions
diff --git a/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt b/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt
index 50e88f2b..21bbe72d 100644
--- a/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt
+++ b/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt
@@ -4,12 +4,14 @@ import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.DokkaGenerator
import org.jetbrains.dokka.EnvironmentAndFacade
import org.jetbrains.dokka.pages.PlatformData
+import org.jetbrains.dokka.plugability.DokkaPlugin
import org.jetbrains.dokka.utilities.DokkaLogger
internal class DokkaTestGenerator(
private val configuration: DokkaConfiguration,
private val logger: DokkaLogger,
- private val testMethods: TestMethods
+ private val testMethods: TestMethods,
+ private val pluginOverrides: List<DokkaPlugin> = emptyList()
) {
fun generate() = with(testMethods) {
@@ -18,7 +20,7 @@ internal class DokkaTestGenerator(
val platforms: Map<PlatformData, EnvironmentAndFacade> = dokkaGenerator.setUpAnalysis(configuration)
analysisSetupStage(platforms)
- val context = dokkaGenerator.initializePlugins(configuration, logger, platforms)
+ val context = dokkaGenerator.initializePlugins(configuration, logger, platforms, pluginOverrides)
pluginsSetupStage(context)
val modulesFromPlatforms = dokkaGenerator.createDocumentationModels(platforms, context)
diff --git a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt
index fa61bf59..b8817918 100644
--- a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt
+++ b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt
@@ -6,6 +6,7 @@ import org.jetbrains.dokka.pages.ModulePageNode
import org.jetbrains.dokka.pages.PlatformData
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.junit.rules.TemporaryFolder
import java.io.File
@@ -26,6 +27,7 @@ abstract class AbstractCoreTest {
protected fun testFromData(
configuration: DokkaConfigurationImpl,
cleanupOutput: Boolean = true,
+ pluginOverrides: List<DokkaPlugin> = emptyList(),
block: TestBuilder.() -> Unit
) {
val testMethods = TestBuilder().apply(block).build()
@@ -36,13 +38,14 @@ abstract class AbstractCoreTest {
configuration.copy(
outputDir = tempDir.root.toPath().toAbsolutePath().toString()
)
- DokkaTestGenerator(newConfiguration, logger, testMethods).generate()
+ DokkaTestGenerator(newConfiguration, logger, testMethods, pluginOverrides).generate()
}
protected fun testInline(
query: String,
configuration: DokkaConfigurationImpl,
cleanupOutput: Boolean = true,
+ pluginOverrides: List<DokkaPlugin> = emptyList(),
block: TestBuilder.() -> Unit
) {
val testMethods = TestBuilder().apply(block).build()
@@ -57,7 +60,7 @@ abstract class AbstractCoreTest {
passesConfigurations = configuration.passesConfigurations
.map { it.copy(sourceRoots = it.sourceRoots.map { it.copy(path = "${testDirPath.toAbsolutePath()}/${it.path}") }) }
)
- DokkaTestGenerator(newConfiguration, logger, testMethods).generate()
+ DokkaTestGenerator(newConfiguration, logger, testMethods, pluginOverrides).generate()
}
private fun String.toFileMap(): Map<String, String> = this.trimMargin().removePrefix("|")