Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -95,6 +96,7 @@ class AffectedModuleDetectorPlugin : Plugin<Project> {
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 ->
Expand Down Expand Up @@ -125,6 +127,7 @@ class AffectedModuleDetectorPlugin : Plugin<Project> {
)
}

@Suppress("UnstableApiUsage")
@VisibleForTesting
internal fun registerInternalTask(
rootProject: Project,
Expand All @@ -134,6 +137,7 @@ class AffectedModuleDetectorPlugin : Plugin<Project> {
val task = rootProject.tasks.register(taskType.commandByImpact).get()
task.group = groupName
task.description = taskType.taskDescription
disableConfigCache(task)

rootProject.subprojects { project ->
project.afterEvaluate {
Expand All @@ -150,6 +154,12 @@ class AffectedModuleDetectorPlugin : Plugin<Project> {
}
}

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,
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion sample/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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