Skip to content

Commit

Permalink
Fix logic to declare incompatibility with configuration cache (#3438)
Browse files Browse the repository at this point in the history
(cherry picked from commit 205a96a)
  • Loading branch information
3flex authored and whyoleg committed Jan 19, 2024
1 parent c17451e commit fdff1ed
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import org.gradle.api.tasks.*
import org.gradle.kotlin.dsl.listProperty
import org.gradle.kotlin.dsl.mapProperty
import org.gradle.kotlin.dsl.property
import org.gradle.util.GradleVersion
import org.gradle.work.DisableCachingByDefault
import org.jetbrains.dokka.*
import org.jetbrains.dokka.plugability.ConfigurableBlock
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() {
Expand Down Expand Up @@ -238,8 +238,7 @@ 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) {
if (GradleVersion.current() >= GradleVersion.version("7.4")) {
super.notCompatibleWithConfigurationCache("Dokka tasks are not yet compatible with the Gradle configuration cache. See https://github.com/Kotlin/dokka/issues/1217")
}
}
Expand Down

0 comments on commit fdff1ed

Please sign in to comment.