diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/kotlin/plugability/DokkaContext.kt | 7 | ||||
-rw-r--r-- | core/src/main/kotlin/plugability/DokkaJavaPlugin.kt | 2 | ||||
-rw-r--r-- | core/src/main/kotlin/plugability/extensions.kt | 8 |
3 files changed, 12 insertions, 5 deletions
diff --git a/core/src/main/kotlin/plugability/DokkaContext.kt b/core/src/main/kotlin/plugability/DokkaContext.kt index 8703af4f..ee3215cc 100644 --- a/core/src/main/kotlin/plugability/DokkaContext.kt +++ b/core/src/main/kotlin/plugability/DokkaContext.kt @@ -128,7 +128,8 @@ private class DokkaContextConfigurationImpl( private fun findNotOverridden(bucket: Set<Extension<*, *, *>>): Extension<*, *, *> { val filtered = bucket.filter { it !in suppressedExtensions } - return filtered.singleOrNull() ?: throw IllegalStateException("Conflicting overrides: $filtered") + return filtered.singleOrNull() + ?: throw IllegalStateException("Conflicting overrides: $filtered") } private fun translateAdjacencyList( @@ -191,7 +192,9 @@ private class DokkaContextConfigurationImpl( } if (extension.override is OverrideKind.Present) { - suppressedExtensions.listFor(extension.override.overriden) += Suppression.ByExtension(extension) + extension.override.overriden.forEach { overriden -> + suppressedExtensions.listFor(overriden) += Suppression.ByExtension(extension) + } } } diff --git a/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt b/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt index 57ca520c..1d8ea8aa 100644 --- a/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt +++ b/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt @@ -46,7 +46,7 @@ data class ExtensionBuilder<T: Any> internal constructor( conditions ) - fun overrideExtension(extension: Extension<T, *, *>) = copy(override = OverrideKind.Present(extension)) + fun overrideExtension(extension: Extension<T, *, *>) = copy(override = OverrideKind.Present(listOf(extension))) fun newOrdering(before: Array<out Extension<*, *, *>>, after: Array<out Extension<*, *, *>>) = copy(before = this.before + before, after = this.after + after) diff --git a/core/src/main/kotlin/plugability/extensions.kt b/core/src/main/kotlin/plugability/extensions.kt index 46739951..8bac4c3e 100644 --- a/core/src/main/kotlin/plugability/extensions.kt +++ b/core/src/main/kotlin/plugability/extensions.kt @@ -16,7 +16,7 @@ sealed class OrderingKind { sealed class OverrideKind { object None : OverrideKind() - class Present(val overriden: Extension<*, *, *>) : OverrideKind() + class Present(val overriden: List<Extension<*, *, *>>) : OverrideKind() } class Extension<T : Any, Ordering : OrderingKind, Override : OverrideKind> internal constructor( @@ -68,8 +68,12 @@ class ExtendingDSL(private val pluginClass: String, private val extensionName: S ) = Extension(extensionPoint, pluginClass, extensionName, action, ordering, override, conditions + condition) infix fun <T : Any, Override : OverrideKind, Ordering: OrderingKind> Extension<T, Ordering, Override>.override( - overriden: Extension<T, *, *> + overriden: List<Extension<T, *, *>> ) = Extension(extensionPoint, pluginClass, extensionName, action, ordering, OverrideKind.Present(overriden), conditions) + + infix fun <T : Any, Override : OverrideKind, Ordering: OrderingKind> Extension<T, Ordering, Override>.override( + overriden: Extension<T, *, *> + ) = this.override(listOf(overriden)) } @ExtensionsDsl |