aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/DokkaBootstrapImpl.kt
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-03-23 22:59:08 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-03-29 18:37:38 +0300
commit57e38932b414e7496678b3cc1f171cbf7c4d8fbb (patch)
tree4658b36056734ceda19be3ce78c62791712aef32 /core/src/main/kotlin/DokkaBootstrapImpl.kt
parent921192e64c7f1df02692c1ec7f24f4a8bc9b7231 (diff)
downloaddokka-57e38932b414e7496678b3cc1f171cbf7c4d8fbb.tar.gz
dokka-57e38932b414e7496678b3cc1f171cbf7c4d8fbb.tar.bz2
dokka-57e38932b414e7496678b3cc1f171cbf7c4d8fbb.zip
Per package options
Diffstat (limited to 'core/src/main/kotlin/DokkaBootstrapImpl.kt')
-rw-r--r--core/src/main/kotlin/DokkaBootstrapImpl.kt11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt
index 8038089f..a52fc9b6 100644
--- a/core/src/main/kotlin/DokkaBootstrapImpl.kt
+++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt
@@ -10,6 +10,17 @@ 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 parseSourceRoot(sourceRoot: String): SourceRoot {
val components = sourceRoot.split("::", limit = 2)
return SourceRoot(components.last(), if (components.size == 1) listOf() else components[0].split(','))