From f7691fe539375e2344babcc6d285de6256006fe0 Mon Sep 17 00:00:00 2001 From: Vadim Mishenev Date: Sat, 26 Nov 2022 22:21:48 +0200 Subject: Mark `outputDirectory` lazy (#2748) --- .../src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaTask.kt | 2 +- .../src/main/kotlin/org/jetbrains/dokka/gradle/DokkaProperty.kt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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 = project.objects.safeProperty() - .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 Property.safeConvention(value: T): Pro return this.convention(value).cast() } +internal inline fun Property.safeConvention(provider: Provider): Property { + return this.convention(provider).cast() +} + @OptIn(ExperimentalStdlibApi::class) internal inline fun Provider.getSafe(): T = if (typeOf().isMarkedNullable) orNull as T -- cgit