Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ant排除一些文件_Ant_Build - Fatal编程技术网

ant排除一些文件

ant排除一些文件,ant,build,Ant,Build,我正在尝试使用ant将文件从sourceDir复制到destDir,我也不想复制某些文件,我将要排除的文件名保留在file:excludelist.txt中。我如何实现这是一个ant目标 使用嵌套exludesfile与嵌套一起使用。 从ant手动文件集: excludesfile=>文件名;此文件的每一行都被带到 必须是排除模式 代码片段: <target name="foo"> <copy todir="path/to/destDir"> <fileset

我正在尝试使用ant将文件从
sourceDir
复制到
destDir
,我也不想复制某些文件,我将要排除的文件名保留在file:excludelist.txt中。我如何实现这是一个ant目标

使用嵌套exludesfile与嵌套一起使用。

从ant手动文件集:

excludesfile=>文件名;此文件的每一行都被带到 必须是排除模式

代码片段:

<target name="foo">
 <copy todir="path/to/destDir">
  <fileset dir="path/to/sourceDir">
   <excludesfile name="excludelist.txt"/>
  </fileset>
 </copy>
</target>


谢谢。我可以把excludelist.txt放在不同的目录而不是sourceDir吗?似乎excludelist.txt与build.xml处于同一级别。再次感谢。实际上excludesfile的name属性name的术语“name”有点误导。事实上,它需要一个文件路径,因此您可以使用。