首页 > 其他 > 详细

ant学习之copy命令

时间:2014-10-28 10:18:29      阅读:223      评论:0      收藏:0      [点我收藏+]
<?xml version="1.0" ?>
<project name="antCopy" default="target1" basedir="../">
    <property name="srcFile" value="E:/workspace/AntDemo/ant/test/test01/1.txt">
    </property>
    <property name="destFile" value="E:/workspace/AntDemo/ant/test/test02/3.txt">
    </property>
    <property name="descDir" value="E:/workspace/AntDemo/ant/test/test02" />
    <property name="destDir" value="E:/workspace/AntDemo/ant/test/test03" />
    <target name="target1">
        <echo message=" ant copy from ${srcFile} to ${destFile}" />
        <copy file="${srcFile}" tofile="${destFile}">
        </copy>
        <copy file="${srcFile}" todir="${descDir}" />
        <copy todir="${destDir}">
                <fileset dir="E:/workspace/AntDemo/ant/test/test02"></fileset>
        </copy>
    </target>
</project>

<!--
  copy 命令
    copy主要用来对文件和目录的复制功能。举例如下:
eg1. 复制单个文件:
<copy file="original.txt" tofile="copied.txt"/>
eg2. 对文件目录进行复制:
<copy todir="../dest_dir">
      <fileset dir="src_dir"/>
 </copy>
eg3. 将文件复制到另外的目录:
<copy file="source.txt" todir="../home/philander"/>
-->

ant学习之copy命令

原文:http://www.cnblogs.com/jfzh/p/4056108.html

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