aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Mishenev <vad-mishenev@yandex.ru>2022-11-26 22:21:48 +0200
committerGitHub <noreply@github.com>2022-11-26 22:21:48 +0200
commitf7691fe539375e2344babcc6d285de6256006fe0 (patch)
tree2657171a17e7227ce4600a7778918f391aaeade1
parent9ed17b64f0dd071afaa4f2e9c507937c4e9571d2 (diff)
downloaddokka-f7691fe539375e2344babcc6d285de6256006fe0.tar.gz
dokka-f7691fe539375e2344babcc6d285de6256006fe0.tar.bz2
dokka-f7691fe539375e2344babcc6d285de6256006fe0.zip
Mark `outputDirectory` lazy (#2748)
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaTask.kt2
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaProperty.kt4
2 files changed, 5 insertions, 1 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaTask.kt
index 52e7d3df..2c761eef 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaTask.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaTask.kt
@@ -33,7 +33,7 @@ abstract class AbstractDokkaTask : DefaultTask() {
@OutputDirectory
val outputDirectory: Property<File> = project.objects.safeProperty<File>()
- .safeConvention(defaultDokkaOutputDirectory())
+ .safeConvention(project.provider { defaultDokkaOutputDirectory() })
@Optional
@InputDirectory
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaProperty.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaProperty.kt
index f20513d2..18026e77 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaProperty.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaProperty.kt
@@ -13,6 +13,10 @@ internal inline fun <reified T : Any> Property<T?>.safeConvention(value: T): Pro
return this.convention(value).cast()
}
+internal inline fun <reified T : Any> Property<T?>.safeConvention(provider: Provider<T?>): Property<T> {
+ return this.convention(provider).cast()
+}
+
@OptIn(ExperimentalStdlibApi::class)
internal inline fun <reified T> Provider<T>.getSafe(): T =
if (typeOf<T>().isMarkedNullable) orNull as T