diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-11-10 11:46:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-10 11:46:54 +0100 |
commit | 8e5c63d035ef44a269b8c43430f43f5c8eebfb63 (patch) | |
tree | 1b915207b2b9f61951ddbf0ff2e687efd053d555 /plugins/all-modules-page/src/test/kotlin/MultiModuleDokkaTestGenerator.kt | |
parent | a44efd4ba0c2e4ab921ff75e0f53fc9335aa79db (diff) | |
download | dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.tar.gz dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.tar.bz2 dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.zip |
Restructure the project to utilize included builds (#3174)
* Refactor and simplify artifact publishing
* Update Gradle to 8.4
* Refactor and simplify convention plugins and build scripts
Fixes #3132
---------
Co-authored-by: Adam <897017+aSemy@users.noreply.github.com>
Co-authored-by: Oleg Yukhnevich <whyoleg@gmail.com>
Diffstat (limited to 'plugins/all-modules-page/src/test/kotlin/MultiModuleDokkaTestGenerator.kt')
-rw-r--r-- | plugins/all-modules-page/src/test/kotlin/MultiModuleDokkaTestGenerator.kt | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/plugins/all-modules-page/src/test/kotlin/MultiModuleDokkaTestGenerator.kt b/plugins/all-modules-page/src/test/kotlin/MultiModuleDokkaTestGenerator.kt deleted file mode 100644 index f3548e4c..00000000 --- a/plugins/all-modules-page/src/test/kotlin/MultiModuleDokkaTestGenerator.kt +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. - */ - -package org.jetbrains.dokka.allModulesPage - -import org.jetbrains.dokka.CoreExtensions -import org.jetbrains.dokka.DokkaConfiguration -import org.jetbrains.dokka.DokkaGenerator -import org.jetbrains.dokka.pages.RootPageNode -import org.jetbrains.dokka.plugability.DokkaContext -import org.jetbrains.dokka.plugability.DokkaPlugin -import org.jetbrains.dokka.testApi.logger.TestLogger -import org.jetbrains.dokka.testApi.testRunner.AbstractTest -import org.jetbrains.dokka.testApi.testRunner.DokkaTestGenerator -import org.jetbrains.dokka.testApi.testRunner.TestBuilder -import org.jetbrains.dokka.testApi.testRunner.TestMethods -import org.jetbrains.dokka.utilities.DokkaConsoleLogger -import org.jetbrains.dokka.utilities.DokkaLogger -import org.jetbrains.dokka.utilities.LoggingLevel - -class MultiModuleDokkaTestGenerator( - configuration: DokkaConfiguration, - logger: DokkaLogger, - testMethods: MultiModuleTestMethods, - additionalPlugins: List<DokkaPlugin> = emptyList() -) : DokkaTestGenerator<MultiModuleTestMethods>( - configuration, - logger, - testMethods, - additionalPlugins + AllModulesPagePlugin() -) { - override fun generate() = with(testMethods) { - val dokkaGenerator = DokkaGenerator(configuration, logger) - - val context = - dokkaGenerator.initializePlugins(configuration, logger, additionalPlugins + AllModulesPagePlugin()) - pluginsSetupStage(context) - - val generation = context.single(CoreExtensions.generation) as AllModulesPageGeneration - - val generationContext = generation.processSubmodules() - submoduleProcessingStage(context) - - val allModulesPage = generation.createAllModulesPage(generationContext) - allModulesPageCreationStage(allModulesPage) - - val transformedPages = generation.transformAllModulesPage(allModulesPage) - pagesTransformationStage(transformedPages) - - generation.render(transformedPages) - renderingStage(transformedPages, context) - - generation.processMultiModule(transformedPages) - processMultiModule(transformedPages) - - generation.finishProcessingSubmodules() - finishProcessingSubmodules(context) - } - -} - -open class MultiModuleTestMethods( - open val pluginsSetupStage: (DokkaContext) -> Unit, - open val allModulesPageCreationStage: (RootPageNode) -> Unit, - open val pagesTransformationStage: (RootPageNode) -> Unit, - open val renderingStage: (RootPageNode, DokkaContext) -> Unit, - open val submoduleProcessingStage: (DokkaContext) -> Unit, - open val processMultiModule: (RootPageNode) -> Unit, - open val finishProcessingSubmodules: (DokkaContext) -> Unit, -) : TestMethods - -class MultiModuleTestBuilder : TestBuilder<MultiModuleTestMethods>() { - var pluginsSetupStage: (DokkaContext) -> Unit = {} - var allModulesPageCreationStage: (RootPageNode) -> Unit = {} - var pagesTransformationStage: (RootPageNode) -> Unit = {} - var renderingStage: (RootPageNode, DokkaContext) -> Unit = { _, _ -> } - var submoduleProcessingStage: (DokkaContext) -> Unit = {} - var processMultiModule: (RootPageNode) -> Unit = {} - var finishProcessingSubmodules: (DokkaContext) -> Unit = {} - - override fun build() = MultiModuleTestMethods( - pluginsSetupStage, - allModulesPageCreationStage, - pagesTransformationStage, - renderingStage, - submoduleProcessingStage, - processMultiModule, - finishProcessingSubmodules - ) -} - -abstract class MultiModuleAbstractTest(logger: TestLogger = TestLogger(DokkaConsoleLogger(LoggingLevel.DEBUG))) : - AbstractTest<MultiModuleTestMethods, MultiModuleTestBuilder, MultiModuleDokkaTestGenerator>( - ::MultiModuleTestBuilder, - ::MultiModuleDokkaTestGenerator, - logger, - ) |