Repository navigation
8.0 (fix): use running AbstractCompile destinationDirectory in PruneGeneratedFactories - #17331
Open
codeconsole wants to merge 1 commit into
Open
codeconsole wants to merge 1 commit into
codeconsole wants to merge 1 commit into
Conversation
codeconsole
requested review from
jamesfredley,
jdaugherty,
matrei and
sbglasius
December 4, 2026 20:52
✅ All tests passed ✅🏷️ Commit: b69cba3 Learn more about TestLens at testlens.app/docs. |
jamesfredley
reviewed
Dec 5, 2026
jamesfredley
left a comment
Contributor
There was a problem hiding this comment.
Requested changes. Forwarding the action to another compile task now prunes that task's destination. An explicit destination that differs from the running task is ignored.
| File classesDirectory = destinationDirectory != null | ||
| ? destinationDirectory.get().asFile | ||
| : ((AbstractCompile) task).destinationDirectory.get().asFile | ||
| Provider<Directory> targetDirectory = task instanceof AbstractCompile |
Contributor
There was a problem hiding this comment.
Construct the action with a destination that is not the destination of the AbstractCompile task that runs it. The action now uses the running task's directory. Stale registrations stay in the directory that was supplied, and the running task's file can be pruned instead. Use the supplied directory when it has a value.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #17330
Summary
In #17318,
PruneGeneratedFactories.executepreferred the captureddestinationDirectoryprovider overtask.destinationDirectory, so forwarding the action fromcompileGroovyto anotherAbstractCompiletask with a different destination directory pruned the source task's destination instead of the running task's destination.Changes
PruneGeneratedFactories.execute(Task)to read((AbstractCompile) task).destinationDirectorywhenevertask instanceof AbstractCompile, falling back to the captureddestinationDirectoryprovider only for non-AbstractCompilewrapper tasks (matching the pattern used in 9.0 (fix): capture indy Provider in VerifyNativeImageIndy instead of casting Task #17319).PruneGeneratedFactoriesSpeccovering forwarding to anotherGroovyCompilewith a different destination (verifying the running task's file is pruned and the source task's file is untouched) and executing the two-argument constructor against a non-AbstractCompiletask.Verification
./gradlew :grails-gradle-plugins:codeStyle :grails-gradle-plugins:testingrails-gradle; all style checks and tests passed.