diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-01-08 14:22:25 +0100 |
---|---|---|
committer | Kamil Doległo <kamilok1965@interia.pl> | 2020-01-08 17:15:50 +0100 |
commit | d1585771c34263f9fb7d9e165ddf9cd349157143 (patch) | |
tree | 128a3dddf56ca329fa843431f5caf2e05ca7767e /core/src/main | |
parent | 9e7154fef3394698dc52c52d61dd1aefde29251e (diff) | |
download | dokka-d1585771c34263f9fb7d9e165ddf9cd349157143.tar.gz dokka-d1585771c34263f9fb7d9e165ddf9cd349157143.tar.bz2 dokka-d1585771c34263f9fb7d9e165ddf9cd349157143.zip |
Fix linking to stdlib with Maven and CLI
Fixes https://github.com/Kotlin/dokka/issues/551 by adding default links in each runner. This should probably be done in one place later on, but I don't see a good place to do it. We can't add it in DokkaGenerator without copying the whole configuration to some default implementation and we can't do it in ExternalDocumentationLinkResolver without redoing it in PackageProvider
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/kotlin/Utilities/Links.kt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Utilities/Links.kt b/core/src/main/kotlin/Utilities/Links.kt new file mode 100644 index 00000000..34423e4e --- /dev/null +++ b/core/src/main/kotlin/Utilities/Links.kt @@ -0,0 +1,18 @@ +package org.jetbrains.dokka.Utilities + +import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.ExternalDocumentationLinkImpl + +fun DokkaConfiguration.PassConfiguration.defaultLinks(): List<ExternalDocumentationLinkImpl> { + val links = mutableListOf<ExternalDocumentationLinkImpl>() + if (!noJdkLink) + links += DokkaConfiguration.ExternalDocumentationLink + .Builder("https://docs.oracle.com/javase/${jdkVersion}/docs/api/") + .build() as ExternalDocumentationLinkImpl + + if (!noStdlibLink) + links += DokkaConfiguration.ExternalDocumentationLink + .Builder("https://kotlinlang.org/api/latest/jvm/stdlib/") + .build() as ExternalDocumentationLinkImpl + return links +} |