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 --- .../kotlin/org/jetbrains/dokka/configuration.kt | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'integration/src') diff --git a/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt b/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt index 7f16b1a5..ca6f0bc4 100644 --- a/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt +++ b/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt @@ -21,6 +21,7 @@ interface DokkaConfiguration { val sourceLinks: List val impliedPlatforms: List val perPackageOptions: List + val externalDocumentationLinks: List interface SourceRoot { val path: String @@ -43,6 +44,20 @@ interface DokkaConfiguration { interface ExternalDocumentationLink { val url: URL val packageListUrl: URL + + open class Builder(open var url: URL? = null, + open var packageListUrl: URL? = null) { + + constructor(root: String) : this(URL(root), null) + + fun build(): DokkaConfiguration.ExternalDocumentationLink = + if (packageListUrl != null && url != null) + ExternalDocumentationLinkImpl(url!!, packageListUrl!!) + else if (url != null) + ExternalDocumentationLinkImpl(url!!, URL(url!!, "package-list")) + else + throw IllegalArgumentException("url or url && packageListUrl must not be null for external documentation link") + } } } @@ -62,4 +77,9 @@ data class SerializeOnlyDokkaConfiguration(override val moduleName: String, override val generateIndexPages: Boolean, override val sourceLinks: List, override val impliedPlatforms: List, - override val perPackageOptions: List) : DokkaConfiguration + override val perPackageOptions: List, + override val externalDocumentationLinks: List) : DokkaConfiguration + + +data class ExternalDocumentationLinkImpl internal constructor(override val url: URL, + override val packageListUrl: URL) : DokkaConfiguration.ExternalDocumentationLink \ No newline at end of file -- cgit