首页 > 其他 > 详细

使用ant拷贝文件

时间:2014-05-26 05:55:27      阅读:402      评论:0      收藏:0      [点我收藏+]

下面是使用ant拷贝文件的一些命令:

<?xml version="1.0" encoding="UTF-8"?>
<project name ="test" default="copy" basedir=".">
<target name ="copy">
<!--拷贝一个文件 -->
<copy file ="myfile.txt" tofile="mycopy.txt"/>

<!--拷贝一个文件到指定目录 -->
<copy file ="myfile.txt" todir="other"/>

<!-- 拷贝一个目录到另一个目录 -->
<copy todir="other">
<fileset dir="bin"/>
</copy>

<!-- 拷贝一个文件集到另一个目录 -->
<copy todir="other">
<fileset dir="bin">
<!--  排除所有的.java文件 -->
<exclude name="**/*.java"/>
</fileset>
</copy>

<!-- 拷贝一个文件集到另一个目录,同时建立备份文件-->
<copy todir="other">
<fileset dir="bin" />
<globmapper from="*" to="*.bak"/>
</copy>

<!-- 使用copydir拷贝一个目录下的东西到另一个目录,includes包含,excludes排除(已过时) -->
<copydir src="bin" 
dest="other"
includes="**/*.java"
excludes="**/Test.java"
/>

<!-- 使用copyfile拷贝一个文件(已过时)-->
<copyfile src ="test.java" dest="other/test.java"/>
</target>
</project>

 

使用ant拷贝文件,布布扣,bubuko.com

使用ant拷贝文件

原文:http://blog.csdn.net/u010142437/article/details/26674447

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!