[英]copydir in ant script
通過使用以下ant腳本,所有文件將從source.dir復制到build.dir
<target name="compile" description="">
<copy todir="${build.dir}">
<fileset dir="${source.dir}"/>
</copy>
</target>
手段:
source/
1.html
2.html
html/
3.html
4.html
build/
1.html
2.html
html/
3.html
4.html
我想要以下內容
source/
1.html
2.html
html/
3.html
4.html
build/
1.html
2.html
3.html
4.html
任何人都可以幫助我,我是螞蟻腳本的新手!
如果要在復制時操作文件名,請復制,您需要一個映射器
<copy todir="${build.dir}">
<fileset dir="${source.dir}"/>
<flattenmapper/>
</copy>
使用Ant移動標記
這是一個例子..
<move file="file.orig" todir="dir/to/move/to"/>
對於多個文件......
<move todir="some/new/dir">
<filelist dir="my/src/dir">
<file name="file1.txt"/>
<file name="file2.txt"/>
</filelist>
</move>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.