diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-06-19 14:08:49 +0200 |
---|---|---|
committer | Paweł Marks <pmarks@virtuslab.com> | 2020-06-25 20:23:58 +0200 |
commit | 8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f (patch) | |
tree | fe4e24d9f352199e551bd34ba330c0d2c0acf7af /runners/cli/src/main/kotlin | |
parent | 08f40e2a13006882e8f8425f111b8527e7bbcb0f (diff) | |
download | dokka-8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f.tar.gz dokka-8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f.tar.bz2 dokka-8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f.zip |
Remove SourceSetDataCache, rename PassConfiguration to DokkaSourceSet and use it instead of SourceSetData
Diffstat (limited to 'runners/cli/src/main/kotlin')
-rw-r--r-- | runners/cli/src/main/kotlin/cli/main.kt | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/runners/cli/src/main/kotlin/cli/main.kt b/runners/cli/src/main/kotlin/cli/main.kt index 80971ae2..37c13442 100644 --- a/runners/cli/src/main/kotlin/cli/main.kt +++ b/runners/cli/src/main/kotlin/cli/main.kt @@ -3,7 +3,7 @@ package org.jetbrains.dokka import com.google.gson.Gson import kotlinx.cli.* import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink -import org.jetbrains.dokka.DokkaConfiguration.PassConfiguration.* +import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet.* import org.jetbrains.dokka.utilities.DokkaConsoleLogger import org.jetbrains.dokka.utilities.cast import java.io.* @@ -31,9 +31,9 @@ class GlobalArguments(args: Array<String>) : DokkaConfiguration { description = "Path to cache folder, or 'default' to use ~/.cache/dokka, if not provided caching is disabled" ) - override val passesConfigurations by parser.option( + override val sourceSets by parser.option( ArgTypeArgument, - description = "Single dokka pass", + description = "Single dokka source set", fullName = "pass" ).multiple() @@ -83,18 +83,18 @@ class GlobalArguments(args: Array<String>) : DokkaConfiguration { init { parser.parse(args) - passesConfigurations.all { + sourceSets.all { it.perPackageOptions.cast<MutableList<DokkaConfiguration.PackageOptions>>() .addAll(parsePerPackageOptions(globalPackageOptions)) } - passesConfigurations.all { + sourceSets.all { it.externalDocumentationLinks.cast<MutableList<ExternalDocumentationLink>>().addAll(parseLinks(globalLinks)) } globalSrcLink.forEach { if (it.isNotEmpty() && it.contains("=")) - passesConfigurations.all { pass -> + sourceSets.all { pass -> pass.sourceLinks.cast<MutableList<SourceLinkDefinitionImpl>>() .add(SourceLinkDefinitionImpl.parseSourceLinkDefinition(it)) } @@ -103,13 +103,13 @@ class GlobalArguments(args: Array<String>) : DokkaConfiguration { } } - passesConfigurations.forEach { + sourceSets.forEach { it.externalDocumentationLinks.cast<MutableList<ExternalDocumentationLink>>().addAll(defaultLinks(it)) } } } -fun passArguments(args: Array<String>): DokkaConfiguration.PassConfiguration { +fun passArguments(args: Array<String>): DokkaConfiguration.DokkaSourceSet { val parser = ArgParser("passConfiguration", prefixStyle = ArgParser.OptionPrefixStyle.JVM) @@ -226,7 +226,7 @@ fun passArguments(args: Array<String>): DokkaConfiguration.PassConfiguration { parser.parse(args) - return object : DokkaConfiguration.PassConfiguration { + return object : DokkaConfiguration.DokkaSourceSet { override val moduleName = moduleName override val displayName = displayName override val sourceSetID = sourceSetID @@ -289,8 +289,8 @@ object ArgTypeSourceLinkDefinition : ArgType<DokkaConfiguration.SourceLinkDefini get() = "{ String that represent source links }" } -object ArgTypeArgument : ArgType<DokkaConfiguration.PassConfiguration>(true) { - override fun convert(value: kotlin.String, name: kotlin.String): DokkaConfiguration.PassConfiguration = +object ArgTypeArgument : ArgType<DokkaConfiguration.DokkaSourceSet>(true) { + override fun convert(value: kotlin.String, name: kotlin.String): DokkaConfiguration.DokkaSourceSet = passArguments(value.split(" ").filter { it.isNotBlank() }.toTypedArray()) override val description: kotlin.String @@ -305,7 +305,7 @@ object ArgTypeHelpPass : ArgType<Any>(false) { get() = "" } -fun defaultLinks(config: DokkaConfiguration.PassConfiguration): MutableList<ExternalDocumentationLink> = +fun defaultLinks(config: DokkaConfiguration.DokkaSourceSet): MutableList<ExternalDocumentationLink> = mutableListOf<ExternalDocumentationLink>().apply { if (!config.noJdkLink) this += DokkaConfiguration.ExternalDocumentationLink |