diff --git a/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorPlugin.kt b/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorPlugin.kt index 9a1d6585..86512fb1 100644 --- a/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorPlugin.kt +++ b/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorPlugin.kt @@ -9,6 +9,7 @@ import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.tasks.testing.Test import org.gradle.internal.impldep.org.jetbrains.annotations.VisibleForTesting +import org.gradle.util.GradleVersion /** * This plugin creates and registers all affected test tasks. @@ -95,6 +96,7 @@ class AffectedModuleDetectorPlugin : Plugin { val task = rootProject.tasks.register(taskType.commandByImpact).get() task.group = CUSTOM_TASK_GROUP_NAME task.description = taskType.taskDescription + disableConfigCache(task) rootProject.subprojects { project -> pluginIds.forEach { pluginId -> @@ -125,6 +127,7 @@ class AffectedModuleDetectorPlugin : Plugin { ) } + @Suppress("UnstableApiUsage") @VisibleForTesting internal fun registerInternalTask( rootProject: Project, @@ -134,6 +137,7 @@ class AffectedModuleDetectorPlugin : Plugin { val task = rootProject.tasks.register(taskType.commandByImpact).get() task.group = groupName task.description = taskType.taskDescription + disableConfigCache(task) rootProject.subprojects { project -> project.afterEvaluate { evaluatedProject -> @@ -150,6 +154,12 @@ class AffectedModuleDetectorPlugin : Plugin { } } + private fun disableConfigCache(task: Task) { + if (GradleVersion.current() >= GradleVersion.version("7.4")) { + task.notCompatibleWithConfigurationCache("AMD requires knowledge of what has changed in the file system so we can not cache those values (https://github.com/dropbox/AffectedModuleDetector/issues/150)") + } + } + private fun withPlugin( pluginId: String, task: Task, diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e0ffc7e4..b61ec111 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip diff --git a/sample/gradle/wrapper/gradle-wrapper.properties b/sample/gradle/wrapper/gradle-wrapper.properties index ad9e0cbe..53450a8a 100644 --- a/sample/gradle/wrapper/gradle-wrapper.properties +++ b/sample/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip