Skip to content

Conversation

@Nouran-11
Copy link

@Nouran-11 Nouran-11 commented Jul 17, 2025

Fixes #309

This pull request introduces the foundational work toward making the Nebula Lint plugin compatible with Gradle's Configuration Cache. The changes here are part of my Google Summer of Code 2025 project with Gradle.

The Problem
The plugin currently accesses the Project model directly during the task execution phase . This behavior is a direct violation of Configuration Cache rules and prevents Gradle from caching the task graph, leading to slower builds.

The Solution
This PR adopts the Data Projection Pattern to decouple linting logic from the live Gradle model and introduces partial Configuration Cache support:

ProjectInfo & ProjectTree: New serializable data classes that act as snapshots of the project state, created at configuration time and injected into tasks as Inputs.

Refactored LintGradleTask and Services: The task logic and supporting services now operate on the projected data instead of directly accessing Project.

Introduced a Supplier for use in rules that still require access to the live model (e.g., subclasses of ModelAwareGradleLintRule).
Calling .get() on this supplier at execution time will break Configuration Cache for that run. It's intended as a temporary measure to support ongoing refactoring.

Next Steps
This PR is not the final solution—it introduces partial compatibility. To achieve full compliance, the following work remains:

Refactor Rules Using Project.configurations
Move dependency-based rules to consume data via the ProjectInfo or another serializable projection.

Update ModelAwareGradleLintRule Implementations
The Supplier is a transitional mechanism. The rules using it should be rewritten to operate on static snapshots, removing the need for live model access.

Nouran-11 added 30 commits June 5, 2025 23:24
- Create GradleLintPatchAction at configuration time using ProjectInfo
- Update console output action to use ProjectInfo instead of project
- Avoid accessing project in @TaskAction method
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.

Doesn't work with Gradle 6.5 configuration cache

2 participants