because of some Zip & Copy tasks limitations, I need to zip files without using the Zip task.
I was wondering if it is somehow possible natively in Gradle (using FileTrees) in the same was as there is Copy task together with Project.copy() method.
See the javadoc here which states that the files(...) methods can accept a Closure if you need to delay the evaluation. I’m guessing you can use this in a Zip or Copy task and it will only be evaluated just in time
Hi Lance, late response here. FYI, in my case I am defining the zip task during applying of my plugin. And I get to know the basename of the zip later, during execution of the buildscript. setBaseName only accepts a plain string, so I cannot set it in a closure. The workaround is to call setBaseName on the task in a doFirst block. Another option is to do everything in a doLast and use project.ant.zip.