aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/main/kotlin/Utilities/ServiceLocator.kt2
-rw-r--r--runners/ant/src/main/kotlin/ant/dokka.kt14
2 files changed, 14 insertions, 2 deletions
diff --git a/core/src/main/kotlin/Utilities/ServiceLocator.kt b/core/src/main/kotlin/Utilities/ServiceLocator.kt
index 83c4c65c..fca08f38 100644
--- a/core/src/main/kotlin/Utilities/ServiceLocator.kt
+++ b/core/src/main/kotlin/Utilities/ServiceLocator.kt
@@ -70,7 +70,7 @@ object ServiceLocator {
"jar" -> {
val file = JarFile(URL(it.file.substringBefore("!")).toFile())
try {
- val jarPath = it.file.substringAfterLast("!").removePrefix("/")
+ val jarPath = it.file.substringAfterLast("!").removeSurrounding("/")
file.entries()
.asSequence()
.filter { entry -> !entry.isDirectory && entry.path == jarPath && entry.extension == "properties" }
diff --git a/runners/ant/src/main/kotlin/ant/dokka.kt b/runners/ant/src/main/kotlin/ant/dokka.kt
index 9e38aa22..9428a7ce 100644
--- a/runners/ant/src/main/kotlin/ant/dokka.kt
+++ b/runners/ant/src/main/kotlin/ant/dokka.kt
@@ -53,7 +53,7 @@ class AntPassConfig(task: Task) : DokkaConfiguration.PassConfiguration {
}
override val perPackageOptions: MutableList<DokkaConfiguration.PackageOptions> = mutableListOf()
override val externalDocumentationLinks: List<ExternalDocumentationLink>
- get() = buildExternalLinksBuilders.map { it.build() }
+ get() = buildExternalLinksBuilders.map { it.build() } + defaultExternalDocumentationLinks
override var languageVersion: String? = null
override var apiVersion: String? = null
@@ -76,6 +76,18 @@ class AntPassConfig(task: Task) : DokkaConfiguration.PassConfiguration {
private val buildExternalLinksBuilders: MutableList<ExternalDocumentationLink.Builder> = mutableListOf()
val antSourceLinkDefinition: MutableList<AntSourceLinkDefinition> = mutableListOf()
+ private val defaultExternalDocumentationLinks: List<DokkaConfiguration.ExternalDocumentationLink>
+ get() {
+ val links = mutableListOf<DokkaConfiguration.ExternalDocumentationLink>()
+ if (!noJdkLink)
+ links += DokkaConfiguration.ExternalDocumentationLink.Builder("http://docs.oracle.com/javase/$jdkVersion/docs/api/").build()
+
+ if (!noStdlibLink)
+ links += DokkaConfiguration.ExternalDocumentationLink.Builder("https://kotlinlang.org/api/latest/jvm/stdlib/").build()
+ return links
+ }
+
+
fun setSamples(ref: Path) {
samplesPath.append(ref)
}