From c203be9fb65ee221875b4e1c865bcd289a85e69c Mon Sep 17 00:00:00 2001 From: Błażej Kardyś Date: Fri, 13 Nov 2020 22:05:15 +0100 Subject: Adding multimodule all modules page creation for gfm --- core/src/main/kotlin/plugability/DokkaContext.kt | 7 +++++-- core/src/main/kotlin/plugability/DokkaJavaPlugin.kt | 2 +- core/src/main/kotlin/plugability/extensions.kt | 8 ++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'core/src/main/kotlin/plugability') 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<*, *, *> { 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 internal constructor( conditions ) - fun overrideExtension(extension: Extension) = copy(override = OverrideKind.Present(extension)) + fun overrideExtension(extension: Extension) = copy(override = OverrideKind.Present(listOf(extension))) fun newOrdering(before: Array>, after: Array>) = 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>) : OverrideKind() } class Extension 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 Extension.override( - overriden: Extension + overriden: List> ) = Extension(extensionPoint, pluginClass, extensionName, action, ordering, OverrideKind.Present(overriden), conditions) + + infix fun Extension.override( + overriden: Extension + ) = this.override(listOf(overriden)) } @ExtensionsDsl -- cgit