Copy a single file <copy file="myfile.txt" tofile="mycopy.txt"/>Copy a single file to a directory <copy file="myfile.txt" todir="../some/other/dir"/>Copy a directory to another directory <copy todir="../new/dir"> <fileset dir="src_dir"/> </copy>Copy a set of files to a directory <copy todir="../dest/dir"> <fileset dir="src_dir"> <exclude name="**/*.java"/> </fileset> </copy> <copy todir="../dest/dir"> <fileset dir="src_dir" excludes="**/*.java"/> </copy>Copy a set of files to a directory, appending .bak to the file name on the fly <copy todir="../backup/dir"> <fileset dir="src_dir"/> <globmapper from="*" to="*.bak"/> </copy>Copy a set of files to a directory, replacing @TITLE@ with Foo Bar in all files. <copy todir="../backup/dir"> <fileset dir="src_dir"/> <filterset> <filter token="TITLE" value="Foo Bar"/> </filterset> </copy>
用ant的 copy就简单多了,呵呵
<fileset dir="src_dir"/>
</copy>Copy a set of files to a directory <copy todir="../dest/dir">
<fileset dir="src_dir">
<exclude name="**/*.java"/>
</fileset>
</copy> <copy todir="../dest/dir">
<fileset dir="src_dir" excludes="**/*.java"/>
</copy>Copy a set of files to a directory, appending .bak to the file name on the fly <copy todir="../backup/dir">
<fileset dir="src_dir"/>
<globmapper from="*" to="*.bak"/>
</copy>Copy a set of files to a directory, replacing @TITLE@ with Foo Bar in all files. <copy todir="../backup/dir">
<fileset dir="src_dir"/>
<filterset>
<filter token="TITLE" value="Foo Bar"/>
</filterset>
</copy>