Use separate reason for disabling caching Also disable caching if any FileTree is used as output. We don't support DirectoryFileTrees as `@OutputDirectory` outputs either, so no reason to support them in plural outputs either.
Enable caching for most plural outputs When @OutputFiles or @OutputDirectories is used with an Iterable (instead of a Map), we previously disabled caching without much explanation. The original reason for this was that we expected a difference in cardinality of outputs between the task producing the output and the one consuming it. However, if we represent each entry in the collection as an indexed property, then unmatched cardinality will produce a different cache key anyway. Thus there's no need for this limitation.