Skip to content

Comments

archrules-gradle-plugin-development: Add GradleTaskActionRule to detect configuration cache breaking patterns in @TaskAction methods#22

Merged
rpalcolea merged 4 commits intomainfrom
archrules-gradle-plugin-development
Dec 11, 2025
Merged

archrules-gradle-plugin-development: Add GradleTaskActionRule to detect configuration cache breaking patterns in @TaskAction methods#22
rpalcolea merged 4 commits intomainfrom
archrules-gradle-plugin-development

Conversation

@rpalcolea
Copy link
Member

This PR introduces archrules-gradle-plugin-development module (proposed name, happy to change)

Adds GradleTaskActionRule to the archrules-gradle-plugin-development module to detect Gradle 10 breaking changes in task implementations.

The rules provide detection of two patterns that break configuration cache:

  • accessing the Project object in @TaskAction methods via getProject() calls, Project method/field access, or
    Project-typed fields
  • calling getTaskDependencies() in @TaskAction methods.

Both patterns will cause runtime errors in Gradle 10+ and should be refactored to use task properties configured at configuration time instead of execution time.

…ct configuration cache breaking patterns in @TaskAction methods
@rpalcolea rpalcolea merged commit c2b43e3 into main Dec 11, 2025
3 checks passed
@rpalcolea rpalcolea deleted the archrules-gradle-plugin-development branch December 11, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants