aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-07-31 08:26:57 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-14 17:51:11 +0200
commit5e50c7b9d5bc9da46365f43bd6f9346f91ad36f8 (patch)
tree76d20e3d74d471d87eaa0c060d6787861d8c4919 /runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka
parentaa21ab173d60bb69e50e7fc321e8b94c2815b6e8 (diff)
downloaddokka-5e50c7b9d5bc9da46365f43bd6f9346f91ad36f8.tar.gz
dokka-5e50c7b9d5bc9da46365f43bd6f9346f91ad36f8.tar.bz2
dokka-5e50c7b9d5bc9da46365f43bd6f9346f91ad36f8.zip
Replace ExternalDocumentationLink.Builder with factory functions
Diffstat (limited to 'runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka')
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleExternalDocumentationLinkBuilder.kt5
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradlePackageOptionsBuilder.kt2
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceLinkBuilder.kt2
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/toDokkaSourceSetImpl.kt23
4 files changed, 9 insertions, 23 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleExternalDocumentationLinkBuilder.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleExternalDocumentationLinkBuilder.kt
index 2960ba23..23017917 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleExternalDocumentationLinkBuilder.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleExternalDocumentationLinkBuilder.kt
@@ -10,9 +10,8 @@ import org.jetbrains.dokka.ExternalDocumentationLinkImpl
import java.net.URL
class GradleExternalDocumentationLinkBuilder(
- @get:Internal internal val project: Project
-) :
- DokkaConfigurationBuilder<ExternalDocumentationLinkImpl> {
+ @Transient @get:Internal internal val project: Project
+) : DokkaConfigurationBuilder<ExternalDocumentationLinkImpl> {
@Input
val url: Property<URL?> = project.objects.safeProperty()
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradlePackageOptionsBuilder.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradlePackageOptionsBuilder.kt
index 854dc9a0..ba66ad45 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradlePackageOptionsBuilder.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradlePackageOptionsBuilder.kt
@@ -12,7 +12,7 @@ import org.jetbrains.dokka.PackageOptionsImpl
class GradlePackageOptionsBuilder(
- @get:Internal internal val project: Project
+ @Transient @get:Internal internal val project: Project
) : DokkaConfigurationBuilder<PackageOptionsImpl> {
@Input
val prefix: Property<String> = project.objects.safeProperty<String>()
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceLinkBuilder.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceLinkBuilder.kt
index 2cd85c26..54700fe9 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceLinkBuilder.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceLinkBuilder.kt
@@ -9,7 +9,7 @@ import org.jetbrains.dokka.DokkaConfigurationBuilder
import org.jetbrains.dokka.SourceLinkDefinitionImpl
class GradleSourceLinkBuilder(
- @get:Internal internal val project: Project
+ @Transient @get:Internal internal val project: Project
) : DokkaConfigurationBuilder<SourceLinkDefinitionImpl> {
@Input
val path: Property<String> = project.objects.safeProperty<String>()
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/toDokkaSourceSetImpl.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/toDokkaSourceSetImpl.kt
index 5ed0d17f..766f7e55 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/toDokkaSourceSetImpl.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/toDokkaSourceSetImpl.kt
@@ -1,6 +1,7 @@
package org.jetbrains.dokka.gradle
import org.jetbrains.dokka.*
+import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink
import java.io.File
import java.net.URL
@@ -44,31 +45,17 @@ private fun GradleDokkaSourceSetBuilder.externalDocumentationLinksWithDefaults()
return externalDocumentationLinks.getSafe().build()
.run {
if (noJdkLink.get()) this
- else this + ExternalDocumentationLink(
- url =
- if (jdkVersion.getSafe() < 11) "https://docs.oracle.com/javase/" +
- "${jdkVersion.getSafe()}/docs/api/"
- else "https://docs.oracle.com/en/java/javase/" +
- "${jdkVersion.getSafe()}/docs/api/java.base/",
- packageListUrl =
- if (jdkVersion.getSafe() < 11) "https://docs.oracle.com/javase/" +
- "${jdkVersion.getSafe()}/docs/api/package-list"
- else "https://docs.oracle.com/en/java/javase/" +
- "${jdkVersion.getSafe()}/docs/api/element-list"
- )
+ else this + ExternalDocumentationLink.jdk(jdkVersion.getSafe())
}
.run {
if (noStdlibLink.getSafe()) this
- else this + ExternalDocumentationLink("https://kotlinlang.org/api/latest/jvm/stdlib/")
+ else this + ExternalDocumentationLink.kotlinStdlib()
}
.run {
if (noAndroidSdkLink.getSafe() || !project.isAndroidProject()) this
else this +
- ExternalDocumentationLink("https://developer.android.com/reference/") +
- ExternalDocumentationLink(
- url = URL("https://developer.android.com/reference/kotlin/"),
- packageListUrl = URL("https://developer.android.com/reference/androidx/package-list")
- )
+ ExternalDocumentationLink.androidSdk() +
+ ExternalDocumentationLink.androidX()
}
.toSet()
}