From 0e8733ead6d5c4c6db7e4fe8a1f34b7598823290 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Thu, 11 May 2017 16:31:04 +0300 Subject: Add external documentation links argument to gradle, maven, ant --- runners/ant/src/main/kotlin/ant/dokka.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'runners/ant') diff --git a/runners/ant/src/main/kotlin/ant/dokka.kt b/runners/ant/src/main/kotlin/ant/dokka.kt index f645aea4..83d7e8ac 100644 --- a/runners/ant/src/main/kotlin/ant/dokka.kt +++ b/runners/ant/src/main/kotlin/ant/dokka.kt @@ -6,6 +6,7 @@ import org.apache.tools.ant.Task import org.apache.tools.ant.types.Path import org.apache.tools.ant.types.Reference import org.jetbrains.dokka.* +import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink import java.io.File class AntLogger(val task: Task): DokkaLogger { @@ -47,6 +48,7 @@ class DokkaAntTask: Task() { val antSourceLinks: MutableList = arrayListOf() val antSourceRoots: MutableList = arrayListOf() val antPackageOptions: MutableList = arrayListOf() + val antExternalDocumentationLinks = mutableListOf() fun setClasspath(classpath: Path) { compileClasspath.append(classpath) @@ -86,6 +88,8 @@ class DokkaAntTask: Task() { fun createPackageOptions(): AntPackageOptions = AntPackageOptions().apply { antPackageOptions.add(this) } + fun createExternalDocumentationLink() = ExternalDocumentationLink.Builder().apply { antExternalDocumentationLinks.add(this) } + override fun execute() { if (sourcePath.list().isEmpty() && antSourceRoots.isEmpty()) { throw BuildException("At least one source path needs to be specified") @@ -114,7 +118,9 @@ class DokkaAntTask: Task() { sourceLinks = sourceLinks, jdkVersion = jdkVersion, impliedPlatforms = impliedPlatforms.split(','), - perPackageOptions = antPackageOptions) + perPackageOptions = antPackageOptions, + externalDocumentationLinks = antExternalDocumentationLinks.map { it.build() } + ) ) generator.generate() } -- cgit