From 1882138d0558d0465c97f34ac86a7b5102de0191 Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Tue, 4 Feb 2020 11:53:31 +0100 Subject: Adds conditional plugin linking --- core/src/main/kotlin/plugability/DokkaPlugin.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/src/main/kotlin/plugability/DokkaPlugin.kt') diff --git a/core/src/main/kotlin/plugability/DokkaPlugin.kt b/core/src/main/kotlin/plugability/DokkaPlugin.kt index 3f82000d..1fcbd934 100644 --- a/core/src/main/kotlin/plugability/DokkaPlugin.kt +++ b/core/src/main/kotlin/plugability/DokkaPlugin.kt @@ -1,5 +1,6 @@ package org.jetbrains.dokka.plugability +import org.jetbrains.dokka.DokkaConfiguration import kotlin.properties.ReadOnlyProperty import kotlin.reflect.KProperty import kotlin.reflect.KProperty1 @@ -36,10 +37,10 @@ abstract class DokkaPlugin { }.also { thisRef.extensionDelegates += property } } - internal fun internalInstall(ctx: DokkaContextConfiguration) { + internal fun internalInstall(ctx: DokkaContextConfiguration, configuration: DokkaConfiguration) { extensionDelegates.asSequence() .filterIsInstance>>() // should be always true .map { it.get(this) } - .forEach { ctx.addExtensionDependencies(it) } + .forEach { if(it.condition.invoke(configuration)) ctx.addExtensionDependencies(it) } } } \ No newline at end of file -- cgit