diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/kotlin/DokkaBootstrapImpl.kt | 41 | ||||
-rw-r--r-- | core/src/main/kotlin/utilities/DokkaLogging.kt | 4 |
2 files changed, 21 insertions, 24 deletions
diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt index d39ee1d5..e0f014c8 100644 --- a/core/src/main/kotlin/DokkaBootstrapImpl.kt +++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt @@ -8,28 +8,25 @@ import org.jetbrains.dokka.utilities.DokkaLogger import java.util.function.BiConsumer -fun parsePerPackageOptions(arg: String): List<PackageOptions> { - if (arg.isBlank()) return emptyList() - - return arg.split(";").map { it.split(",") }.map { - val prefix = it.first() - if (prefix == "") - throw IllegalArgumentException("Please do not register packageOptions with all match pattern, use global settings instead") - val args = it.subList(1, it.size) - val deprecated = args.find { it.endsWith("deprecated") }?.startsWith("+") ?: true - val reportUndocumented = args.find { it.endsWith("reportUndocumented") }?.startsWith("+") ?: true - val privateApi = args.find { it.endsWith("privateApi") }?.startsWith("+") ?: false - val suppress = args.find { it.endsWith("suppress") }?.startsWith("+") ?: false - PackageOptionsImpl( - prefix, - includeNonPublic = privateApi, - reportUndocumented = reportUndocumented, - skipDeprecated = !deprecated, - suppress = suppress - ) - } +fun parsePerPackageOptions(args: List<String>): List<PackageOptions> = args.map { it.split(",") }.map { + val prefix = it.first() + if (prefix == "") + throw IllegalArgumentException("Please do not register packageOptions with all match pattern, use global settings instead") + val args = it.subList(1, it.size) + val deprecated = args.find { it.endsWith("deprecated") }?.startsWith("+") ?: true + val reportUndocumented = args.find { it.endsWith("reportUndocumented") }?.startsWith("+") ?: true + val privateApi = args.find { it.endsWith("privateApi") }?.startsWith("+") ?: false + val suppress = args.find { it.endsWith("suppress") }?.startsWith("+") ?: false + PackageOptionsImpl( + prefix, + includeNonPublic = privateApi, + reportUndocumented = reportUndocumented, + skipDeprecated = !deprecated, + suppress = suppress + ) } + class DokkaBootstrapImpl : DokkaBootstrap { class DokkaProxyLogger(val consumer: BiConsumer<String, String>) : DokkaLogger { @@ -60,9 +57,9 @@ class DokkaBootstrapImpl : DokkaBootstrap { if (warningsCount > 0 || errorsCount > 0) { println( "Generation completed with $warningsCount warning" + - (if (DokkaConsoleLogger.warningsCount == 1) "" else "s") + + (if (warningsCount == 1) "" else "s") + " and $errorsCount error" + - if (DokkaConsoleLogger.errorsCount == 1) "" else "s" + if (errorsCount == 1) "" else "s" ) } else { println("generation completed successfully") diff --git a/core/src/main/kotlin/utilities/DokkaLogging.kt b/core/src/main/kotlin/utilities/DokkaLogging.kt index 1c05c95d..4b671f7b 100644 --- a/core/src/main/kotlin/utilities/DokkaLogging.kt +++ b/core/src/main/kotlin/utilities/DokkaLogging.kt @@ -27,9 +27,9 @@ object DokkaConsoleLogger : DokkaLogger { override fun report() { if (warningsCount > 0 || errorsCount > 0) { - println("Generation completed with warningsCount warning" + + println("Generation completed with $warningsCount warning" + (if(warningsCount == 1) "" else "s") + - " and errorsCount error" + + " and $errorsCount error" + if(errorsCount == 1) "" else "s" ) } else { |