diff options
| author | Dmitry Jemerov <yole@jetbrains.com> | 2016-01-12 13:52:31 +0100 |
|---|---|---|
| committer | Dmitry Jemerov <yole@jetbrains.com> | 2016-01-12 13:52:31 +0100 |
| commit | da2cf094df5e8bc0470823e7154be84dcd578cd2 (patch) | |
| tree | 0ec18b806ce603a2f874b8b7c610221353c259fe /core/src/main/kotlin/ant | |
| parent | 628356d63443b11ff2221707c54a397f548d38a4 (diff) | |
| download | dokka-da2cf094df5e8bc0470823e7154be84dcd578cd2.tar.gz dokka-da2cf094df5e8bc0470823e7154be84dcd578cd2.tar.bz2 dokka-da2cf094df5e8bc0470823e7154be84dcd578cd2.zip | |
allow specifying JDK version to use for JDK links
Diffstat (limited to 'core/src/main/kotlin/ant')
| -rw-r--r-- | core/src/main/kotlin/ant/dokka.kt | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/core/src/main/kotlin/ant/dokka.kt b/core/src/main/kotlin/ant/dokka.kt index 713bd193..f7441463 100644 --- a/core/src/main/kotlin/ant/dokka.kt +++ b/core/src/main/kotlin/ant/dokka.kt @@ -5,6 +5,7 @@ import org.apache.tools.ant.Project import org.apache.tools.ant.Task import org.apache.tools.ant.types.Path import org.apache.tools.ant.types.Reference +import org.jetbrains.dokka.DocumentationOptions import org.jetbrains.dokka.DokkaGenerator import org.jetbrains.dokka.DokkaLogger import org.jetbrains.dokka.SourceLinkDefinition @@ -22,6 +23,7 @@ class DokkaAntTask(): Task() { var moduleName: String? = null var outputDir: String? = null var outputFormat: String = "html" + var jdkVersion: Int = 6 var skipDeprecated: Boolean = false @@ -77,14 +79,8 @@ class DokkaAntTask(): Task() { throw BuildException("Output directory needs to be specified") } val sourceLinks = antSourceLinks.map { - val path = it.path - if (path == null) { - throw BuildException("Path attribute of a <sourceLink> element is required") - } - val url = it.url - if (url == null) { - throw BuildException("Path attribute of a <sourceLink> element is required") - } + val path = it.path ?: throw BuildException("'path' attribute of a <sourceLink> element is required") + val url = it.url ?: throw BuildException("'url' attribute of a <sourceLink> element is required") SourceLinkDefinition(File(path).canonicalFile.absolutePath, url, it.lineSuffix) } @@ -98,10 +94,10 @@ class DokkaAntTask(): Task() { samplesPath.list().toList(), includesPath.list().toList(), moduleName!!, - outputDir!!, - outputFormat, - sourceLinks, - skipDeprecated + DocumentationOptions(outputDir!!, outputFormat, + skipDeprecated = skipDeprecated, + sourceLinks = sourceLinks, + jdkVersion = jdkVersion) ) generator.generate() } |
