aboutsummaryrefslogtreecommitdiff
path: root/runners/maven-plugin/src/main/kotlin
diff options
context:
space:
mode:
authorFilip Zybała <fzybala@virtuslab.com>2020-03-25 13:16:10 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-03-31 13:05:43 +0200
commit0b3a58eb0ac6330b380e36147761b4dbe1c05281 (patch)
treed30f7c606cb0307d86b2489af6fe0569a527b241 /runners/maven-plugin/src/main/kotlin
parentca2d5042c608951cd2f12ccc324543b59b7cc154 (diff)
downloaddokka-0b3a58eb0ac6330b380e36147761b4dbe1c05281.tar.gz
dokka-0b3a58eb0ac6330b380e36147761b4dbe1c05281.tar.bz2
dokka-0b3a58eb0ac6330b380e36147761b4dbe1c05281.zip
Fixed maven and CLI runners stdlib links bug
Diffstat (limited to 'runners/maven-plugin/src/main/kotlin')
-rw-r--r--runners/maven-plugin/src/main/kotlin/DokkaMojo.kt19
1 files changed, 18 insertions, 1 deletions
diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
index cfe278ce..49c6fba6 100644
--- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
+++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
@@ -185,6 +185,19 @@ abstract class AbstractDokkaMojo : AbstractMojo() {
throw MojoExecutionException("Incorrect path property, only Unix based path allowed.")
}
}
+ fun defaultLinks(config: PassConfigurationImpl): List<ExternalDocumentationLinkImpl> {
+ val links = mutableListOf<ExternalDocumentationLinkImpl>()
+ if (!config.noJdkLink)
+ links += DokkaConfiguration.ExternalDocumentationLink
+ .Builder("https://docs.oracle.com/javase/${config.jdkVersion}/docs/api/")
+ .build() as ExternalDocumentationLinkImpl
+
+ if (!config.noStdlibLink)
+ links += DokkaConfiguration.ExternalDocumentationLink
+ .Builder("https://kotlinlang.org/api/latest/jvm/stdlib/")
+ .build() as ExternalDocumentationLinkImpl
+ return links
+ }
val passConfiguration = PassConfigurationImpl(
classpath = classpath,
@@ -218,7 +231,11 @@ abstract class AbstractDokkaMojo : AbstractMojo() {
targets = targets,
includeNonPublic = includeNonPublic,
includeRootPackage = includeRootPackage
- )
+ ).let{
+ it.copy(
+ externalDocumentationLinks = defaultLinks(it) + it.externalDocumentationLinks
+ )
+ }
val logger = MavenDokkaLogger(log)