使用grails ant创建zip时重命名文件

时间:2015-08-17 12:17:08

标签: grails ant

我有这个蚂蚁代码,但我想用antBuilder将它写成grails:

<zip destfile="${dist}/manual.zip">
    <zipfileset dir="htdocs/manual" prefix="docs/user-guide"/>
    <zipfileset dir="." includes="ChangeLog27.txt"fullpath="docs/ChangeLog.txt"/>
    <zipfileset src="examples.zip" includes="**/*.html" prefix="docs/examples"/>
</zip>

1 个答案:

答案 0 :(得分:0)

这对我有用

new AntBuilder()。zip(destFile:“$ {dist} /manual.zip”){

   zipfileset( dir:"htdocs/manual", includes: "${measureId}.xml", prefix:     "docs/user-guide" )

   zipfileset(  dir: "." , includes: "ChangeLog27.txt" ,fullpath: "docs/ChangeLog.txt" )

   zipfileset(src: "examples.zip",includes:"**/*.html",prefix:"docs/examples")

}