diff options
author | Simon Ogorodnik <sem-oro@yandex.ru> | 2017-04-07 23:22:28 +0300 |
---|---|---|
committer | Simon Ogorodnik <sem-oro@yandex.ru> | 2017-04-07 23:22:28 +0300 |
commit | 212b33e6a68801f59badc712f313596ce258dc03 (patch) | |
tree | a104caf9bbdc1f6655eb7f4c82fe87bc0d319990 /core/src/main/kotlin/DokkaBootstrapImpl.kt | |
parent | 1e79c85980e9259549a76c3f8c3410582cbf4eff (diff) | |
download | dokka-212b33e6a68801f59badc712f313596ce258dc03.tar.gz dokka-212b33e6a68801f59badc712f313596ce258dc03.tar.bz2 dokka-212b33e6a68801f59badc712f313596ce258dc03.zip |
Fix parsing of per package options in CLI mode
Diffstat (limited to 'core/src/main/kotlin/DokkaBootstrapImpl.kt')
-rw-r--r-- | core/src/main/kotlin/DokkaBootstrapImpl.kt | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt index a52fc9b6..8b10a5e8 100644 --- a/core/src/main/kotlin/DokkaBootstrapImpl.kt +++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt @@ -10,15 +10,19 @@ fun parseSourceLinkDefinition(srcLink: String): SourceLinkDefinition { urlAndLine.substringAfter("#", "").let { if (it.isEmpty()) null else "#" + it }) } -fun parsePerPackageOptions(arg: String): List<PackageOptions> = 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("warnUndocumented") }?.startsWith("+") ?: true - val privateApi = args.find { it.endsWith("privateApi") }?.startsWith("+") ?: false - PackageOptions(prefix, includeNonPublic = privateApi, reportUndocumented = reportUndocumented, skipDeprecated = !deprecated) +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("warnUndocumented") }?.startsWith("+") ?: true + val privateApi = args.find { it.endsWith("privateApi") }?.startsWith("+") ?: false + PackageOptions(prefix, includeNonPublic = privateApi, reportUndocumented = reportUndocumented, skipDeprecated = !deprecated) + } } fun parseSourceRoot(sourceRoot: String): SourceRoot { |