diff options
author | Szymon Świstun <sswistun@virtuslab.com> | 2020-02-11 17:01:06 +0100 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-02-12 13:33:10 +0100 |
commit | 2a60f8adbab66e7b671949960c7cd90ea86992d7 (patch) | |
tree | f26363d9307886f240c185b939b2fe14ec6ef5bc /core/src/main | |
parent | c5f9921bb5f6408be1d334f32167dcdc53a44286 (diff) | |
download | dokka-2a60f8adbab66e7b671949960c7cd90ea86992d7.tar.gz dokka-2a60f8adbab66e7b671949960c7cd90ea86992d7.tar.bz2 dokka-2a60f8adbab66e7b671949960c7cd90ea86992d7.zip |
plugin overrides
Diffstat (limited to 'core/src/main')
-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() } |