aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-04-10 18:44:55 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-04-10 18:44:55 +0300
commitfccbf5536b44f6c12859b45358fdedab5c255b8d (patch)
tree4109d8db41f48b037b2d09a4046777af7ad5a0ff /core/src
parentf65fbf534807c168a81f4e80919680ca7dcff47b (diff)
parent212b33e6a68801f59badc712f313596ce258dc03 (diff)
downloaddokka-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.kt22
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 {