-
Notifications
You must be signed in to change notification settings - Fork 5k
Description
Current Behavior
When switching from a branch in which a certain subproject is part of an included build (configured via settings.gradle
) to a branch where the project is directly in the root build (without any change in directory structure), gradle does not use its previously written state to determine which class files are stale and should be deleted.
Expected Behavior
Gradle cleans stale compile output regardless of how the state file was created, or it completely deletes all output if it detects some kind of state mismatch.
Context (optional)
This is quite a corner case and it took a while to track down. We use the same executors for the development branch and older release builds, so the "poisoned" executors broke multiple branches in our CI. Doing clean builds would defeat the purpose of having warmed-up executors, which is why we're not doing that.
Gradle Slack discussion: https://gradle-community.slack.com/archives/CAHSN3LDN/p1750068793575899
Self-contained Reproducer Project
See https://github.com/mkm-dt/gradle-stale-repro for code and instructions
Gradle version
8.14.2
Build scan URL (optional)
No response
Your Environment (optional)
No response