Add note about output caching and inherited functions#2094
Open
bric3 wants to merge 2 commits into
Open
Conversation
Clarify that inherited CopySpec functions disable output caching, indeed, most are actually invoking the `DefaultCopySpec.appendCopyAction` which disable output caching.
Goooler
reviewed
Jul 8, 2026
| [`filesMatching`][Jar.filesMatching], [`filesNotMatching`][Jar.filesNotMatching], or [`eachFile`][Jar.eachFile] functions | ||
| to set their `duplicatesStrategy` to `INCLUDE` or `WARN`. | ||
|
|
||
| Note, however that functions inherited from [`CopySpec`][CopySpec], such as [`filesMatching`][Jar.filesMatching], [`filesNotMatching`][Jar.filesNotMatching], [`eachFile`][Jar.eachFile], or others, disable the output caching. |
Member
There was a problem hiding this comment.
There is no footer link for CopySpec. And any source for 'disable the output caching'?
Contributor
Author
There was a problem hiding this comment.
Fixed, thanks!
So I didn't found anything in user doc, but found the information inside the gradle source (9.6 at least)
The DefaultCopySpec methods like fileMatching end up calling eachFile which toggle a flag hasCustomActions that is consulted in AbstractCopyTask the parent to all archive tasks.
Contributor
Author
There was a problem hiding this comment.
I actually I walked history a bit and this is pretty old, it was introduced in Gradle 3.2
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.
Clarify that inherited
CopySpecfunctions disable output caching, indeed, most are actually invoking theDefaultCopySpec.appendCopyActionwhich disable output caching.Changelog not updated as it's not a behavioral change.