Zip files/Directories in Groovy with AntBuilder

时光毁灭记忆、已成空白 提交于 2019-12-01 00:25:57

If you look at the docs for the ant zip task, the includes parameter is described as:

comma- or space-separated list of patterns of files that must be included

So you're right, that it is the space separator that's breaking it...

You need to use the longer route to get this to work:

new AntBuilder().zip( destFile: "${file}.zip" ) {
  fileset( dir: './Testing' ) {
    include( name:file.name )
  }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!