Skip to content

Commit

Permalink
Merge pull request #144 from dropbox/jfein/fix-config-cache-issues
Browse files Browse the repository at this point in the history
Fix code to better support when running project with configuration cache
  • Loading branch information
joshafeinberg authored May 12, 2022
2 parents 6c2b902 + 6897aa6 commit 1c807f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ abstract class AffectedModuleDetector {
)
}

private fun isProjectEnabled(project: Project): Boolean {
internal fun isProjectEnabled(project: Project): Boolean {
return project.hasProperty(ENABLE_ARG)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ class AffectedModuleDetectorPlugin : Plugin<Project> {
task.description = taskType.taskDescription

rootProject.subprojects { project ->
project.afterEvaluate {
project.afterEvaluate { evaluatedProject ->
pluginIds.forEach { pluginId ->
if (pluginId == PLUGIN_JAVA_LIBRARY || pluginId == PLUGIN_KOTLIN) {
if (taskType == InternalTaskType.ANDROID_JVM_TEST) {
withPlugin(pluginId, task, InternalTaskType.JVM_TEST, project)
withPlugin(pluginId, task, InternalTaskType.JVM_TEST, evaluatedProject)
}
} else {
withPlugin(pluginId, task, taskType, project)
withPlugin(pluginId, task, taskType, evaluatedProject)
}
}
}
Expand All @@ -163,8 +163,11 @@ class AffectedModuleDetectorPlugin : Plugin<Project> {
}

project.afterEvaluate {
project.tasks.findByPath(path)?.onlyIf {
AffectedModuleDetector.isProjectAffected(project)
project.tasks.findByPath(path)?.onlyIf { task ->
when {
!AffectedModuleDetector.isProjectEnabled(task.project) -> true
else -> AffectedModuleDetector.isProjectAffected(task.project)
}
}
}
}
Expand Down

0 comments on commit 1c807f0

Please sign in to comment.