diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-07-09 11:04:34 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-07-13 14:23:08 +0200 |
commit | bb942786909961443eb1ff7feee90c190040ed49 (patch) | |
tree | eb78a14b01645d614497475fba7ec33710fbffc6 /core | |
parent | 824e5240d2f7b1bda775be22e12a95c0f8f2b0eb (diff) | |
download | dokka-bb942786909961443eb1ff7feee90c190040ed49.tar.gz dokka-bb942786909961443eb1ff7feee90c190040ed49.tar.bz2 dokka-bb942786909961443eb1ff7feee90c190040ed49.zip |
Refactor dokka tasks classpath configuration
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/kotlin/DokkaBootstrap.kt | 6 | ||||
-rw-r--r-- | core/src/main/kotlin/DokkaBootstrapImpl.kt | 22 | ||||
-rw-r--r-- | core/src/main/kotlin/DokkaMultimoduleBootstrapImpl.kt | 7 |
3 files changed, 20 insertions, 15 deletions
diff --git a/core/src/main/kotlin/DokkaBootstrap.kt b/core/src/main/kotlin/DokkaBootstrap.kt index b78eb9c6..ffaae03e 100644 --- a/core/src/main/kotlin/DokkaBootstrap.kt +++ b/core/src/main/kotlin/DokkaBootstrap.kt @@ -3,8 +3,6 @@ package org.jetbrains.dokka import java.util.function.BiConsumer interface DokkaBootstrap { - - fun configure(logger: BiConsumer<String, String>, serializedConfigurationJSON: String) - + fun configure(serializedConfigurationJSON: String, logger: BiConsumer<String, String>) fun generate() -}
\ No newline at end of file +} diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt index be3d6c9b..936fbe6c 100644 --- a/core/src/main/kotlin/DokkaBootstrapImpl.kt +++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt @@ -37,6 +37,10 @@ fun parsePerPackageOptions(args: List<String>): List<PackageOptions> = args.map } +/** + * Accessed with reflection + */ +@Suppress("unused") class DokkaBootstrapImpl : DokkaBootstrap { class DokkaProxyLogger(val consumer: BiConsumer<String, String>) : DokkaLogger { @@ -95,20 +99,18 @@ class DokkaBootstrapImpl : DokkaBootstrap { return links } - val configurationWithLinks = - configuration.copy( - sourceSets = - sourceSets.map { - val links: List<ExternalDocumentationLinkImpl> = - it.externalDocumentationLinks + defaultLinks(it) - it.copy(externalDocumentationLinks = links) - } - ) + val configurationWithLinks = configuration.copy( + sourceSets = sourceSets.map { + val links: List<ExternalDocumentationLinkImpl> = + it.externalDocumentationLinks + defaultLinks(it) + it.copy(externalDocumentationLinks = links) + } + ) generator = DokkaGenerator(configurationWithLinks, logger) } - override fun configure(logger: BiConsumer<String, String>, serializedConfigurationJSON: String) = configure( + override fun configure(serializedConfigurationJSON: String, logger: BiConsumer<String, String>) = configure( DokkaProxyLogger(logger), DokkaConfigurationImpl(serializedConfigurationJSON) ) diff --git a/core/src/main/kotlin/DokkaMultimoduleBootstrapImpl.kt b/core/src/main/kotlin/DokkaMultimoduleBootstrapImpl.kt index 70b99f8d..c0726584 100644 --- a/core/src/main/kotlin/DokkaMultimoduleBootstrapImpl.kt +++ b/core/src/main/kotlin/DokkaMultimoduleBootstrapImpl.kt @@ -1,3 +1,8 @@ +/** + * Accessed with reflection + */ +@file:Suppress("unused") + package org.jetbrains.dokka import org.jetbrains.dokka.DokkaBootstrapImpl.DokkaProxyLogger @@ -12,7 +17,7 @@ class DokkaMultimoduleBootstrapImpl : DokkaBootstrap { generator = DokkaGenerator(configuration, logger) } - override fun configure(logger: BiConsumer<String, String>, serializedConfigurationJSON: String) = configure( + override fun configure(serializedConfigurationJSON: String, logger: BiConsumer<String, String>) = configure( DokkaProxyLogger(logger), DokkaConfigurationImpl(serializedConfigurationJSON) ) |