I’m using Gradle M6 (I’ve also tried this with M8 with the same result).
I have a series of copy tasks that all share the same destination tree. Some of the tasks put their files in the root of the tree; others put the files further down. Originally, all these tasks shared the same destinationDirectory and used from() { into } to control where the files went.
As I was trying to diagnose some speed issues, I noticed that, if I cleared the destination directory first, the smaller copy tasks would complete almost instantly; but that if the entire destination tree were present, then the copy tasks could take 15 or 20 seconds to complete.
I’ve gone back through those tasks and changed the destinationDirectory to be as deep into the tree as possible; this has sped them up greatly. Even so, there are a couple of tasks that have to copy their files into the tree root, and these still take 15 or 20 seconds to run.
It looks like the up-to-date checker is examining the entire destination directory recursively, not just looking at the files that would be created by the copy task. Is this a bug/known issue/expected behavior?
Is there something I can do to speed up the copy tasks that copy into the tree root?