I found out that when doing exploded war construction for development purpose, doing ant.copy is a lot faster than using copy { into ‘dir’; with war }.
The problem with gradle copy is that it isnt really doing the copy incrementally (while the task itself have up-to-date checking); at least that is what I understand from here https://github.com/gradle/gradle/issues/1643 .
On the other hand, Ant’s Copy task only copy ‘newer’ file.
The question: is there an easy way to reuse war copySpec to ant.copy() ?
I tried both Copy and Sync.
Both are painfully slow; at least in Windows 10 needing to copy/sync thousand of small files.
Ant’s copy is a lot faster since it has timestamp checking; only newer files are being copied.
As far as I know this method of copying is not yet supported in Gradle.
Adds an action to be applied to each file as it is about to be copied into its destination. The action can change the destination path of the file, filter the contents of the file, or exclude the file from the result entirely. Actions are executed in the order added, and are inherited from the parent spec.