aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/plugability/DokkaPlugin.kt
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-02-04 11:53:31 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-02-11 10:15:32 +0100
commit1882138d0558d0465c97f34ac86a7b5102de0191 (patch)
tree9391587f8992856437c8f37ba4fdfca98bc4ff85 /core/src/main/kotlin/plugability/DokkaPlugin.kt
parent62a2848a1187c61c62907a000f8bc3b3199923e3 (diff)
downloaddokka-1882138d0558d0465c97f34ac86a7b5102de0191.tar.gz
dokka-1882138d0558d0465c97f34ac86a7b5102de0191.tar.bz2
dokka-1882138d0558d0465c97f34ac86a7b5102de0191.zip
Adds conditional plugin linking
Diffstat (limited to 'core/src/main/kotlin/plugability/DokkaPlugin.kt')
-rw-r--r--core/src/main/kotlin/plugability/DokkaPlugin.kt5
1 files changed, 3 insertions, 2 deletions
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<KProperty1<DokkaPlugin, Extension<*>>>() // 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