diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-04-10 18:44:55 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-04-10 18:44:55 +0300 |
commit | fccbf5536b44f6c12859b45358fdedab5c255b8d (patch) | |
tree | 4109d8db41f48b037b2d09a4046777af7ad5a0ff /core/src | |
parent | f65fbf534807c168a81f4e80919680ca7dcff47b (diff) | |
parent | 212b33e6a68801f59badc712f313596ce258dc03 (diff) | |
download | dokka-fccbf5536b44f6c12859b45358fdedab5c255b8d.tar.gz dokka-fccbf5536b44f6c12859b45358fdedab5c255b8d.tar.bz2 dokka-fccbf5536b44f6c12859b45358fdedab5c255b8d.zip |
Merge branch 'fix-parse-package-options'
Diffstat (limited to 'core/src')
-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 { |