2016-07-15 181 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

相關問題