|
The <copy> and <delete> command is used to copy the files and deleting the files from one folder to the other. For example:-
The following script copies all files in directories called images that are located in the directory tree defined by ${src} to the destination directory defined by ${dist} , but excludes all *.gif files from the copy.
<copy todir="${dist}">
<fileset dir="${src}" includes="**/images/*" excludes="**/*.gif" />
</copy>
The above task is also achieved by nested elements. The following script will demonstrate the use of the nested elements.
<copy todir="${dist}">
<fileset dir="${src}">
<include name="**/images/*"/>
<exclude name="**/*.gif"/>
</fileset>
</copy>
The following is the example for the delete task.
The following command deleted all the files from /images folders but exclude all the gif files from delete.
<delete dir="${dist}">
<include name="**/images/*"/>
<exclude name="**/*.gif"/>
</delete>
|