Ant复制文件

 1 <?xml version="1.0" encoding="UTF-8"?>  
 2 <project name ="test" default="copy" basedir=".">  
 3 <target name ="copy">  
 4 <!--拷贝一个文件 -->  
 5 <copy file ="myfile.txt" tofile="mycopy.txt"/>  
 6   
 7 <!--拷贝一个文件到指定目录 -->  
 8 <copy file ="myfile.txt" todir="other"/>  
 9   
10 <!-- 拷贝一个目录到另一个目录 -->  
11 <copy todir="other">  
12 <fileset dir="bin"/>  
13 </copy>  
14   
15 <!-- 拷贝一个文件集到另一个目录 -->  
16 <copy todir="other">  
17 <fileset dir="bin">  
18 <!--  排除所有的.java文件 -->  
19 <exclude name="**/*.java"/>  
20 </fileset>  
21 </copy>  
22   
23 <!-- 拷贝一个文件集到另一个目录,同时建立备份文件-->  
24 <copy todir="other">  
25 <fileset dir="bin" />  
26 <globmapper from="*" to="*.bak"/>  
27 </copy>  
28   
29 <!-- 使用copydir拷贝一个目录下的东西到另一个目录,includes包含,excludes排除(已过时) -->  
30 <copydir src="bin"   
31 dest="other"  
32 includes="**/*.java"  
33 excludes="**/Test.java"  
34 />  
35   
36 <!-- 使用copyfile拷贝一个文件(已过时)-->  
37 <copyfile src ="test.java" dest="other/test.java"/>  
38 </target>  
39 </project>  

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值