aboutsummaryrefslogtreecommitdiff
path: root/runners/cli/src/main
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat@beresnev.me>2021-12-23 14:32:18 +0300
committerGitHub <noreply@github.com>2021-12-23 14:32:18 +0300
commitbfd41ce2a0d43419a671961c19b7d755cffdcfc8 (patch)
tree00d1fcd75ff7c25de20c8b0621e3bfb11cd3f61a /runners/cli/src/main
parent5c98d42ec08ca1413f920e4f5dde28d330e8837a (diff)
downloaddokka-bfd41ce2a0d43419a671961c19b7d755cffdcfc8.tar.gz
dokka-bfd41ce2a0d43419a671961c19b7d755cffdcfc8.tar.bz2
dokka-bfd41ce2a0d43419a671961c19b7d755cffdcfc8.zip
Introduce documentedVisibilities setting (#2270)
* Introduce `documentedVisibilities` setting * Remove hardcoded doc generation for Visibility.PUBLIC, correct tests * Add maven, gradle and cli integration tests for documentedVisibilities * Fix maven plugin configuration overriding the default value * Remove test debug prints * Correct an inconsistency with default values and leave a comment of intentions * Add a test for visibility of private setter
Diffstat (limited to 'runners/cli/src/main')
-rw-r--r--runners/cli/src/main/kotlin/cli/main.kt14
1 files changed, 14 insertions, 0 deletions
diff --git a/runners/cli/src/main/kotlin/cli/main.kt b/runners/cli/src/main/kotlin/cli/main.kt
index 7a7a5582..739539a9 100644
--- a/runners/cli/src/main/kotlin/cli/main.kt
+++ b/runners/cli/src/main/kotlin/cli/main.kt
@@ -204,6 +204,11 @@ private fun parseSourceSet(moduleName: String, args: Array<String>): DokkaConfig
val includeNonPublic: Boolean by parser.option(ArgType.Boolean, description = "Include non public")
.default(DokkaDefaults.includeNonPublic)
+ val documentedVisibilities by parser.option(
+ ArgTypeVisibility,
+ description = "Visibilities to be documented (allows multiple values separated by the semicolon `;`)"
+ ).delimiter(";")
+
val reportUndocumented by parser.option(ArgType.Boolean, description = "Report undocumented members")
.default(DokkaDefaults.reportUndocumented)
@@ -290,6 +295,8 @@ private fun parseSourceSet(moduleName: String, args: Array<String>): DokkaConfig
override val noStdlibLink = noStdlibLink
override val noJdkLink = noJdkLink
override val suppressedFiles = suppressedFiles.toMutableSet()
+ override val documentedVisibilities: Set<DokkaConfiguration.Visibility> = documentedVisibilities.toSet()
+ .ifEmpty { DokkaDefaults.documentedVisibilities }
}
}
@@ -305,6 +312,13 @@ object ArgTypePlatform : ArgType<Platform>(true) {
get() = "{ String that represents platform }"
}
+object ArgTypeVisibility : ArgType<DokkaConfiguration.Visibility>(true) {
+ override fun convert(value: kotlin.String, name: kotlin.String) = DokkaConfiguration.Visibility.fromString(value)
+ override val description: kotlin.String
+ get() = "{ String that represents a visibility modifier. " +
+ "Possible values: ${DokkaConfiguration.Visibility.values().joinToString(separator = ", ")} }"
+}
+
object ArgTypePlugin : ArgType<DokkaConfiguration.PluginConfiguration>(true) {
override fun convert(
value: kotlin.String,