aboutsummaryrefslogtreecommitdiff
path: root/src/main.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-14 19:34:28 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-14 19:34:28 +0400
commit1aa62f8071939f1a2b3640e00378cd86b8599b9c (patch)
tree47c2c9add7695702cc4f8d3fa898d68123f27875 /src/main.kt
parent94b3ed6fae39c121e67ee80596c10de93a206695 (diff)
downloaddokka-1aa62f8071939f1a2b3640e00378cd86b8599b9c.tar.gz
dokka-1aa62f8071939f1a2b3640e00378cd86b8599b9c.tar.bz2
dokka-1aa62f8071939f1a2b3640e00378cd86b8599b9c.zip
Classpath support and custom module name from commandline
Diffstat (limited to 'src/main.kt')
-rw-r--r--src/main.kt21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/main.kt b/src/main.kt
index ef46849a..3168aad4 100644
--- a/src/main.kt
+++ b/src/main.kt
@@ -5,6 +5,8 @@ import com.intellij.openapi.util.*
import org.jetbrains.jet.cli.common.messages.*
import org.jetbrains.jet.cli.common.arguments.*
import org.jetbrains.jet.utils.PathUtil
+import com.google.common.base.Splitter
+import java.io.File
class DokkaArguments {
Argument(value = "src", description = "Source file or directory (allows many paths separated by the system path separator)")
@@ -13,7 +15,15 @@ class DokkaArguments {
Argument(value = "output", description = "Output directory path for .md files")
ValueDescription("<path>")
- public var outputDir: String? = null
+ public var outputDir: String = "out/doc/"
+
+ Argument(value = "module", description = "Name of the documentation module")
+ ValueDescription("<name>")
+ public var moduleName: String = ""
+
+ Argument(value = "classpath", description = "Classpath for symbol resolution")
+ ValueDescription("<path>")
+ public var classpath: String = ""
}
public fun main(args: Array<String>) {
@@ -24,7 +34,10 @@ public fun main(args: Array<String>) {
val environment = AnalysisEnvironment(MessageCollectorPlainTextToStream.PLAIN_TEXT_TO_SYSTEM_ERR) {
addClasspath(PathUtil.getJdkClassesRoots())
- // addClasspath(PathUtil.getKotlinPathsForCompiler().getRuntimePath())
+ for (element in arguments.classpath.split(File.pathSeparatorChar)) {
+ addClasspath(File(element))
+ }
+ // addClasspath(PathUtil.getKotlinPathsForCompiler().getRuntimePath())
addSources(sources)
}
@@ -39,11 +52,11 @@ public fun main(args: Array<String>) {
context.getPackageFragment(file)!!.fqName
}.toSet()
- context.createDocumentationModule(module, packageSet)
+ context.createDocumentationModule(arguments.moduleName, module, packageSet)
}
val signatureGenerator = KotlinSignatureGenerator()
- val locationService = FoldersLocationService(arguments.outputDir ?: "out/doc/")
+ val locationService = FoldersLocationService(arguments.outputDir)
val markdown = MarkdownFormatService(locationService, signatureGenerator)
val generator = FileGenerator(signatureGenerator, locationService, markdown)
generator.generate(documentation)