aboutsummaryrefslogtreecommitdiff
path: root/runners/cli
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-06-16 15:35:17 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-06-18 15:34:36 +0200
commitb1520f0a45e5102f77a43dd20746a3db047bbcf4 (patch)
treec7463bdf771e21c4d33084e1f74be161f4a8af71 /runners/cli
parentc853a41545d461fee7af6f0e8aad11569c7d7d53 (diff)
downloaddokka-b1520f0a45e5102f77a43dd20746a3db047bbcf4.tar.gz
dokka-b1520f0a45e5102f77a43dd20746a3db047bbcf4.tar.bz2
dokka-b1520f0a45e5102f77a43dd20746a3db047bbcf4.zip
Implement default configurations
Diffstat (limited to 'runners/cli')
-rw-r--r--runners/cli/src/main/kotlin/cli/main.kt27
1 files changed, 14 insertions, 13 deletions
diff --git a/runners/cli/src/main/kotlin/cli/main.kt b/runners/cli/src/main/kotlin/cli/main.kt
index 515f9bb0..f0df08e0 100644
--- a/runners/cli/src/main/kotlin/cli/main.kt
+++ b/runners/cli/src/main/kotlin/cli/main.kt
@@ -3,6 +3,7 @@ package org.jetbrains.dokka
import com.google.gson.Gson
import kotlinx.cli.*
import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink
+import org.jetbrains.dokka.DokkaConfiguration.PassConfiguration.*
import org.jetbrains.dokka.utilities.DokkaConsoleLogger
import org.jetbrains.kotlin.utils.addToStdlib.cast
import java.io.*
@@ -18,12 +19,12 @@ class GlobalArguments(args: Array<String>) : DokkaConfiguration {
val json: String? by parser.argument(ArgType.String, description = "Json file name").optional()
override val outputDir by parser.option(ArgType.String, description = "Output directory path")
- .default("./dokka")
+ .default(DokkaDefaults.outputDir)
override val format by parser.option(
ArgType.String,
description = "Output format (html, gfm, jekyll)"
- ).default("html")
+ ).default(DokkaDefaults.format)
override val cacheRoot by parser.option(
ArgType.String,
@@ -50,12 +51,12 @@ class GlobalArguments(args: Array<String>) : DokkaConfiguration {
override val offlineMode by parser.option(
ArgType.Boolean,
"Offline mode (do not download package lists from the Internet)"
- ).default(false)
+ ).default(DokkaDefaults.offlineMode)
override val failOnWarning by parser.option(
ArgType.Boolean,
"Throw an exception if the generation exited with warnings"
- ).default(false)
+ ).default(DokkaDefaults.failOnWarning)
val globalPackageOptions by parser.option(
ArgType.String,
@@ -160,26 +161,26 @@ fun passArguments(args: Array<String>): DokkaConfiguration.PassConfiguration {
).delimiter(";")
val includeNonPublic: Boolean by parser.option(ArgType.Boolean, description = "Include non public")
- .default(false)
+ .default(DokkaDefaults.includeNonPublic)
val includeRootPackage by parser.option(ArgType.Boolean, description = "Include non public")
- .default(false)
+ .default(DokkaDefaults.includeRootPackage)
val reportUndocumented by parser.option(ArgType.Boolean, description = "Report undocumented members")
- .default(false)
+ .default(DokkaDefaults.reportUndocumented)
val skipEmptyPackages by parser.option(
ArgType.Boolean,
description = "Do not create index pages for empty packages"
- ).default(false)
+ ).default(DokkaDefaults.skipEmptyPackages)
val skipDeprecated by parser.option(ArgType.Boolean, description = "Do not output deprecated members")
- .default(false)
+ .default(DokkaDefaults.skipDeprecated)
val jdkVersion by parser.option(
ArgType.Int,
description = "Version of JDK to use for linking to JDK JavaDoc"
- ).default(8)
+ ).default(DokkaDefaults.jdkVersion)
val languageVersion by parser.option(
ArgType.String,
@@ -192,10 +193,10 @@ fun passArguments(args: Array<String>): DokkaConfiguration.PassConfiguration {
)
val noStdlibLink by parser.option(ArgType.Boolean, description = "Disable documentation link to stdlib")
- .default(false)
+ .default(DokkaDefaults.noStdlibLink)
val noJdkLink by parser.option(ArgType.Boolean, description = "Disable documentation link to JDK")
- .default(false)
+ .default(DokkaDefaults.noJdkLink)
val suppressedFiles by parser.option(
ArgType.String,
@@ -205,7 +206,7 @@ fun passArguments(args: Array<String>): DokkaConfiguration.PassConfiguration {
val analysisPlatform: Platform by parser.option(
ArgTypePlatform,
description = "Platform for analysis"
- ).default(Platform.DEFAULT)
+ ).default(DokkaDefaults.analysisPlatform)
val perPackageOptions by parser.option(
ArgType.String,