aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka
diff options
context:
space:
mode:
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/GradleDokkaSourceSetBuilder.kt5
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/sourceSetKotlinGistConfiguration.kt10
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt19
3 files changed, 8 insertions, 26 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder.kt
index 1802a737..deff5050 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder.kt
@@ -465,9 +465,9 @@ open class GradleDokkaSourceSetBuilder(
fun externalDocumentationLink(url: URL, packageListUrl: URL? = null) {
externalDocumentationLinks.add(
GradleExternalDocumentationLinkBuilder(project).apply {
- this.url by url
+ this.url.convention(url)
if (packageListUrl != null) {
- this.packageListUrl by packageListUrl
+ this.packageListUrl.convention(packageListUrl)
}
}
)
@@ -475,4 +475,3 @@ open class GradleDokkaSourceSetBuilder(
override fun build(): DokkaSourceSetImpl = toDokkaSourceSetImpl()
}
-
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/sourceSetKotlinGistConfiguration.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/sourceSetKotlinGistConfiguration.kt
index b14e4f52..0a0c7854 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/sourceSetKotlinGistConfiguration.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/sourceSetKotlinGistConfiguration.kt
@@ -14,15 +14,15 @@ internal fun GradleDokkaSourceSetBuilder.configureWithKotlinSourceSetGist(source
sourceSetNames.map { sourceSetName -> DokkaSourceSetID(sourceSetName) }
}
- this.suppress by sourceSet.isMain.map { !it }
+ this.suppress.convention(sourceSet.isMain.map { !it })
this.sourceRoots.from(sourceSet.sourceRoots)
this.classpath.from(sourceSet.classpath)
- this.platform by sourceSet.platform.map { Platform.fromString(it.name) }
- this.dependentSourceSets by dependentSourceSetIds
- this.displayName by sourceSet.platform.map { platform ->
+ this.platform.convention(sourceSet.platform.map { Platform.fromString(it.name) })
+ this.dependentSourceSets.convention(dependentSourceSetIds)
+ this.displayName.convention(sourceSet.platform.map { platform ->
sourceSet.name.substringBeforeLast(
delimiter = "Main",
missingDelimiterValue = platform.name
)
- }
+ })
}
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt
index 1c0c8080..9fcb8e3b 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt
@@ -3,30 +3,13 @@ package org.jetbrains.dokka.gradle
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Project
import org.gradle.api.UnknownDomainObjectException
-import org.gradle.api.provider.HasMultipleValues
-import org.gradle.api.provider.Property
-import org.gradle.api.provider.Provider
import org.gradle.util.Path
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
-internal infix fun <T> Property<T>.by(value: T?) {
- this.set(value)
-}
-
-internal infix fun <T> Property<T>.by(value: Provider<T>) {
- this.set(value)
-}
-
-internal infix fun <T> HasMultipleValues<in T>.by(values: Iterable<T>) {
- this.set(values)
-}
-
-internal infix fun <T> HasMultipleValues<in T>.by(values: Provider<out Iterable<T>>) {
- this.set(values)
-}
+/** Parse a Gradle path, e.g. `:project:subproject:taskName` */
internal fun parsePath(path: String): Path = Path.path(path)
internal val Project.kotlinOrNull: KotlinProjectExtension?