2016-07-15 186 views
0

我在将ant目录从源文件复制到目标文件时遇到问题。使用copydir命令将文件夹从源文件复制到build.xml文件中

代码: -

<target name="getResources" depends="init"> 
    <delete dir="${resources.dir}"/>  
    <copy file="${svn.resources.url}" tofile="${resources.dir} " /> 
</target> 

错误: -

build.xml:150: Use a resource collection to copy directories. 

请建议我如何从源复制目录的目的地。我使用了几种方法...像

<export srcUrl="" destPath="">这也是说,不推荐使用和也。但没有一个属性正在工作。请告诉我该怎么做。

回答

1
<!-- copy one file --> 
<copy file="/home/guest/workspace/so/src/build.xml" tofile="/home/guest/workspace/so/src/build2.xml" /> 

<!-- copy a folder recuresively --> 
<copy todir="/home/guest/workspace/so/src2"> 
    <fileset dir="/home/guest/workspace/so/src" includes="**" /> 
</copy> 

您可能还需要看看副本任务的文档和例子here

相关问题