def ant = new AntBuilder()
ant.copy(todir:"backup" ){
fileset(dir:"images" )
}
// build.xml
<project name="test" basedir="." >
<target name="backupImages" >
<copy todir="backup" >
<fileset dir="images" />
</copy>
</target>
</project>
ant.copy(todir:"backup" ){
fileset(dir:"images" )
}
// build.xml
<project name="test" basedir="." >
<target name="backupImages" >
<copy todir="backup" >
<fileset dir="images" />
</copy>
</target>
</project>
To copy an entire directory of files (including subdirectories), you need to use a nested fileset. Notice that the nested XML shows up as a nested closure in Groovy.
Groovy这种语法真的是挺特别的