Given the following task:
task zipit (type: Zip) {
from buildDir
destinationDir buildDir
baseName ‘output’
version ‘1.0’
}
The generated .zip file contains another .zip file of the same name. However, the nested .zip file is not a valid .zip file. I take it that the Zip task follows the following algorithm:
- Create an appropriately named .zip file in the ‘destinationDir’ 2. Enumerate the sources 3. Stuff the .zip file with the sources
I can get around this by adding an ‘exclude’ parameter like:
task zipit (type: Zip) {
from buildDir
destinationDir buildDir
exclude ‘output*.zip’
baseName ‘output’
version ‘1.0’
}
But I feel like the algorithm is broken and should be this instead:
- Enumerate the sources 2. Create an appropriately named .zip file in the ‘destinationDir’ 3. Stuff the .zip file with the sources
Hopefully no one is relying on this odd behavior. Does it sound like a bug to you guys?