diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-07-18 12:18:59 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-14 17:51:11 +0200 |
commit | eae1ce49d18c2978b49166ea502bf2c109a85504 (patch) | |
tree | 477f39e33f14c71042f06eecc938d6efaa95e66c /core/src/main/kotlin/DokkaBootstrapImpl.kt | |
parent | 6c635551ed3ea0cfe5f04b54a98cb28225061d26 (diff) | |
download | dokka-eae1ce49d18c2978b49166ea502bf2c109a85504.tar.gz dokka-eae1ce49d18c2978b49166ea502bf2c109a85504.tar.bz2 dokka-eae1ce49d18c2978b49166ea502bf2c109a85504.zip |
Simplify Dokka Gradle Plugin
Diffstat (limited to 'core/src/main/kotlin/DokkaBootstrapImpl.kt')
-rw-r--r-- | core/src/main/kotlin/DokkaBootstrapImpl.kt | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt index a2efab41..584d8b8c 100644 --- a/core/src/main/kotlin/DokkaBootstrapImpl.kt +++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt @@ -70,38 +70,8 @@ class DokkaBootstrapImpl : DokkaBootstrap { private lateinit var generator: DokkaGenerator - fun configure(logger: DokkaLogger, configuration: DokkaConfigurationImpl) = with(configuration) { - - fun defaultLinks(config: DokkaSourceSetImpl): List<ExternalDocumentationLinkImpl> { - val links = mutableListOf<ExternalDocumentationLinkImpl>() - if (!config.noJdkLink) { - val javadocLink = - if (config.jdkVersion < 11) "https://docs.oracle.com/javase/${config.jdkVersion}/docs/api/" - else "https://docs.oracle.com/en/java/javase/${config.jdkVersion}/docs/api/java.base/" - val packageListLink = - if (config.jdkVersion < 11) "${javadocLink}/package-list" - else "https://docs.oracle.com/en/java/javase/${config.jdkVersion}/docs/api/element-list" - links += DokkaConfiguration.ExternalDocumentationLink - .Builder(javadocLink, packageListLink) - .build() as ExternalDocumentationLinkImpl - } - - if (!config.noStdlibLink) - links += DokkaConfiguration.ExternalDocumentationLink - .Builder("https://kotlinlang.org/api/latest/jvm/stdlib/") - .build() as ExternalDocumentationLinkImpl - return links - } - - val configurationWithLinks = configuration.copy( - sourceSets = sourceSets.map { - val links: List<ExternalDocumentationLinkImpl> = - it.externalDocumentationLinks + defaultLinks(it) - it.copy(externalDocumentationLinks = links) - } - ) - - generator = DokkaGenerator(configurationWithLinks, logger) + fun configure(logger: DokkaLogger, configuration: DokkaConfigurationImpl) { + generator = DokkaGenerator(configuration, logger) } override fun configure(serializedConfigurationJSON: String, logger: BiConsumer<String, String>) = configure( |