diff options
author | aSemy <897017+aSemy@users.noreply.github.com> | 2023-01-30 22:26:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-30 22:26:27 +0100 |
commit | e43249b992ba087b3ce0f2f1226281210015a8d1 (patch) | |
tree | cb10019562a06db4994748f23afc498d89283a77 /runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka | |
parent | 6ddd978e44134febffc857e9cd871982b4c6d36b (diff) | |
download | dokka-e43249b992ba087b3ce0f2f1226281210015a8d1.tar.gz dokka-e43249b992ba087b3ce0f2f1226281210015a8d1.tar.bz2 dokka-e43249b992ba087b3ce0f2f1226281210015a8d1.zip |
Replace `by` helper function with the standard `set()` (#2834)
Diffstat (limited to 'runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka')
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? |