From bec2cac91726e52884329e7997207e9777abaab7 Mon Sep 17 00:00:00 2001 From: Benoit Lubek Date: Fri, 25 Aug 2023 20:03:04 +0200 Subject: Mark tasks as not compatible with the Gradle configuration cache (#3070) --- .../kotlin/org/jetbrains/dokka/gradle/tasks/AbstractDokkaTask.kt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'runners/gradle-plugin/src') diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/tasks/AbstractDokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/tasks/AbstractDokkaTask.kt index 066374e5..1f679da8 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/tasks/AbstractDokkaTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/tasks/AbstractDokkaTask.kt @@ -23,6 +23,7 @@ import org.jetbrains.dokka.plugability.DokkaPlugin import java.util.concurrent.atomic.AtomicReference import java.util.function.BiConsumer import kotlin.reflect.full.createInstance +import kotlin.reflect.full.memberFunctions @DisableCachingByDefault(because = "Abstract super-class, not to be instantiated directly") abstract class AbstractDokkaTask : DefaultTask() { @@ -232,6 +233,11 @@ abstract class AbstractDokkaTask : DefaultTask() { init { group = JavaBasePlugin.DOCUMENTATION_GROUP + // notCompatibleWithConfigurationCache was introduced in Gradle 7.4 + val containsNotCompatibleWithConfigurationCache = this::class.memberFunctions.any { it.name == "notCompatibleWithConfigurationCache" && it.parameters.firstOrNull()?.name == "reason" } + if (containsNotCompatibleWithConfigurationCache) { + super.notCompatibleWithConfigurationCache("Dokka tasks are not yet compatible with the Gradle configuration cache. See https://github.com/Kotlin/dokka/issues/1217") + } } internal fun buildPluginsConfiguration(): List { -- cgit