diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/kotlin/DokkaGenerator.kt | 7 | ||||
-rw-r--r-- | core/src/main/kotlin/plugability/DokkaContext.kt | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/core/src/main/kotlin/DokkaGenerator.kt b/core/src/main/kotlin/DokkaGenerator.kt index fef71aab..a31c04a6 100644 --- a/core/src/main/kotlin/DokkaGenerator.kt +++ b/core/src/main/kotlin/DokkaGenerator.kt @@ -6,10 +6,10 @@ import com.intellij.psi.PsiManager import org.jetbrains.dokka.analysis.AnalysisEnvironment import org.jetbrains.dokka.analysis.DokkaResolutionFacade import org.jetbrains.dokka.model.Module -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.plugability.single import org.jetbrains.dokka.utilities.DokkaLogger import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys @@ -66,8 +66,9 @@ class DokkaGenerator( fun initializePlugins( configuration: DokkaConfiguration, logger: DokkaLogger, - platforms: Map<PlatformData, EnvironmentAndFacade> - ) = DokkaContext.create(configuration, logger, platforms) + platforms: Map<PlatformData, EnvironmentAndFacade>, + pluginOverrides: List<DokkaPlugin> = emptyList() + ) = DokkaContext.create(configuration, logger, platforms, pluginOverrides) fun createDocumentationModels( platforms: Map<PlatformData, EnvironmentAndFacade>, diff --git a/core/src/main/kotlin/plugability/DokkaContext.kt b/core/src/main/kotlin/plugability/DokkaContext.kt index e6286f0b..6a8ac4a3 100644 --- a/core/src/main/kotlin/plugability/DokkaContext.kt +++ b/core/src/main/kotlin/plugability/DokkaContext.kt @@ -25,7 +25,8 @@ interface DokkaContext { fun create( configuration: DokkaConfiguration, logger: DokkaLogger, - platforms: Map<PlatformData, EnvironmentAndFacade> + platforms: Map<PlatformData, EnvironmentAndFacade>, + pluginOverrides: List<DokkaPlugin> ): DokkaContext = DokkaContextConfigurationImpl(logger, configuration, platforms).apply { configuration.pluginsClasspath.map { it.relativeTo(File(".").absoluteFile).toURI().toURL() } @@ -33,6 +34,7 @@ interface DokkaContext { .let { URLClassLoader(it, this.javaClass.classLoader) } .also { checkClasspath(it) } .let { ServiceLoader.load(DokkaPlugin::class.java, it) } + .let { it + pluginOverrides } .forEach { install(it) } applyExtensions() }.also { it.logInitialisationInfo() } |