如何使 Ant 副本中的 Ant 文件列表协同工作 [英] How to make work together an Ant filelist inside an Ant copy
问题描述
我想使用以下文件列表(Ant)的结果:
I would like to use the result of the following filelist (Ant):
<filelist id="docfiles" dir="doc">
<file name="foo.xml"/>
<file name="bar.xml"/>
</filelist>
进入以下副本:
<copy todir="folder">
???
</copy>
我已经尝试将它们组合在一起,例如:
I have already tried to put them together like:
<copy todir="folder">
<filelist id="docfiles" dir="doc">
<file name="foo.xml"/>
<file name="bar.xml"/>
</filelist>
</copy>
但是 Ant 回答说在这样的任务中不支持 FileLists.谢谢.
But Ant answer that FileLists is not supported in a such task. Thanks.
推荐答案
如最新Ant 复制任务 文档:
参数指定为嵌套元素fileset
或任何其他资源集合
Parameters specified as nested elements
fileset
or any other resource collection
资源集合用于选择要复制的文件组.要使用资源集合,必须设置 todir 属性.
Resource Collections are used to select groups of files to copy. To use a resource collection, the todir attribute must be set.
在 Ant 1.7 之前,仅支持
作为嵌套元素.
Prior to Ant 1.7 only <fileset>
has been supported as a nested element.
由于资源集合包括:
- fileset、dirset、filelist 和 path(以及派生类型)公开文件资源
- tarfileset 可以根据配置公开文件或 tarentry 资源
- zipfileset 可以根据配置公开文件或 zipentry 资源
- propertyset 公开属性资源
copy
元素中的 filelist
应该适用于 Ant 1.7.
A filelist
within a copy
element should work in Ant 1.7.
Ant 1.6.x 不支持它.
It will not be supported with Ant 1.6.x.
这篇关于如何使 Ant 副本中的 Ant 文件列表协同工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!