From bfd41ce2a0d43419a671961c19b7d755cffdcfc8 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Thu, 23 Dec 2021 14:32:18 +0300 Subject: 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 --- runners/cli/src/main/kotlin/cli/main.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'runners/cli/src/main') 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): 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): DokkaConfig override val noStdlibLink = noStdlibLink override val noJdkLink = noJdkLink override val suppressedFiles = suppressedFiles.toMutableSet() + override val documentedVisibilities: Set = documentedVisibilities.toSet() + .ifEmpty { DokkaDefaults.documentedVisibilities } } } @@ -305,6 +312,13 @@ object ArgTypePlatform : ArgType(true) { get() = "{ String that represents platform }" } +object ArgTypeVisibility : ArgType(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(true) { override fun convert( value: kotlin.String, -- cgit