The Gradle documentation says in the “How to work with files” chapter, about the Copy task :
You can also use the Project.copy() method to copy files. It works the same way as the task.
AFAICT this is far from being true, and my experience is that it confuses a lot of Gradle users.
For the Copy task, when the output of an other task is used in a ‘from’ clause, the Copy task implicitly add the child task as a dependency of the Copy task (because the output of the child task is a Buildable I guess)
For the copy() method, of course it does not happen (as the copy() method is imperatively used in the Action of an other task), and, as the copy behavior ignore the non existing files, the copy silently ignore the output of the task (or worse, the output of the child task is copied but is not up to date). If i’m not mistaken, to get the correct behavior, the user must explicitly add the child task as a dependency of the task where the copy() method is used.
Maybe this behavior should be described in the documentation.