aboutsummaryrefslogtreecommitdiff
path: root/runners/cli
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-06-26 16:13:23 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-06-26 16:13:23 +0300
commit9870752d4106c08c10fd70dd5cc35ae8a64c8c8d (patch)
treef99503dc4ec66a76c11b72662dc05753d635ef5b /runners/cli
parent6805bae192908c287ffd0fcad9ece50541db0e46 (diff)
downloaddokka-9870752d4106c08c10fd70dd5cc35ae8a64c8c8d.tar.gz
Add deleted cli-parser
Diffstat (limited to 'runners/cli')
-rw-r--r--runners/cli/build.gradle1
-rw-r--r--runners/cli/src/main/kotlin/cli/main.kt18
2 files changed, 6 insertions, 13 deletions
diff --git a/runners/cli/build.gradle b/runners/cli/build.gradle
index a1d9d4d6f..13b0c941b 100644
--- a/runners/cli/build.gradle
+++ b/runners/cli/build.gradle
@@ -4,4 +4,5 @@ sourceCompatibility = 1.6
dependencies {
compile project(":core")
+ compile "com.github.spullara.cli-parser:cli-parser:1.1.1"
}
diff --git a/runners/cli/src/main/kotlin/cli/main.kt b/runners/cli/src/main/kotlin/cli/main.kt
index 70336b9ed..c12166c53 100644
--- a/runners/cli/src/main/kotlin/cli/main.kt
+++ b/runners/cli/src/main/kotlin/cli/main.kt
@@ -1,10 +1,10 @@
package org.jetbrains.dokka
+import com.sampullara.cli.Args
+import com.sampullara.cli.Argument
import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink
-import org.jetbrains.kotlin.cli.common.arguments.ValueDescription
-import org.jetbrains.kotlin.cli.common.parser.com.sampullara.cli.Args
-import org.jetbrains.kotlin.cli.common.parser.com.sampullara.cli.Argument
+
import java.io.File
import java.net.MalformedURLException
import java.net.URL
@@ -12,35 +12,27 @@ import java.net.URLClassLoader
class DokkaArguments {
@set:Argument(value = "src", description = "Source file or directory (allows many paths separated by the system path separator)")
- @ValueDescription("<path>")
var src: String = ""
@set:Argument(value = "srcLink", description = "Mapping between a source directory and a Web site for browsing the code")
- @ValueDescription("<path>=<url>[#lineSuffix]")
var srcLink: String = ""
@set:Argument(value = "include", description = "Markdown files to load (allows many paths separated by the system path separator)")
- @ValueDescription("<path>")
var include: String = ""
@set:Argument(value = "samples", description = "Source root for samples")
- @ValueDescription("<path>")
var samples: String = ""
@set:Argument(value = "output", description = "Output directory path")
- @ValueDescription("<path>")
var outputDir: String = "out/doc/"
@set:Argument(value = "format", description = "Output format (text, html, markdown, jekyll, kotlin-website)")
- @ValueDescription("<name>")
var outputFormat: String = "html"
@set:Argument(value = "module", description = "Name of the documentation module")
- @ValueDescription("<name>")
var moduleName: String = ""
@set:Argument(value = "classpath", description = "Classpath for symbol resolution")
- @ValueDescription("<path>")
var classpath: String = ""
@set:Argument(value = "nodeprecated", description = "Exclude deprecated members from documentation")
@@ -90,7 +82,7 @@ object MainKt {
@JvmStatic
fun entry(args: Array<String>) {
val arguments = DokkaArguments()
- val freeArgs: List<String> = Args.parse(arguments, args, false) ?: listOf()
+ val freeArgs: List<String> = Args.parse(arguments, args) ?: listOf()
val sources = if (arguments.src.isNotEmpty()) arguments.src.split(File.pathSeparatorChar).toList() + freeArgs else freeArgs
val samples = if (arguments.samples.isNotEmpty()) arguments.samples.split(File.pathSeparatorChar).toList() else listOf()
val includes = if (arguments.include.isNotEmpty()) arguments.include.split(File.pathSeparatorChar).toList() else listOf()
@@ -166,7 +158,7 @@ object MainKt {
@JvmStatic
fun main(args: Array<String>) {
val arguments = DokkaArguments()
- Args.parse(arguments, args, false)
+ Args.parse(arguments, args)
if (arguments.outputFormat == "javadoc")
startWithToolsJar(args)