diff options
author | Błażej Kardyś <bkardys@virtuslab.com> | 2020-11-13 22:05:15 +0100 |
---|---|---|
committer | Błażej Kardyś <bkardys@virtuslab.com> | 2020-11-27 03:15:02 +0100 |
commit | c203be9fb65ee221875b4e1c865bcd289a85e69c (patch) | |
tree | 40384c13d98f722dbb7c819f8ebadb6caac01651 /core/src/main/kotlin/plugability | |
parent | 4639cbda50359c8dcbaa61f0a960c002c060d3b9 (diff) | |
download | dokka-c203be9fb65ee221875b4e1c865bcd289a85e69c.tar.gz dokka-c203be9fb65ee221875b4e1c865bcd289a85e69c.tar.bz2 dokka-c203be9fb65ee221875b4e1c865bcd289a85e69c.zip |
Adding multimodule all modules page creation for gfm
Diffstat (limited to 'core/src/main/kotlin/plugability')
-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 |