使用Apache Ant 1.7.1蚂蚁filterset任务不递归
它看起来像蚂蚁筛选任务时递归设置为true不能多次解决同一个属性的一条线。我在Ant文档中找不到任何提及。这是否应该发生?
使用这种蚂蚁构建文件:
<project basedir="." default="assemble" >
<macrodef name="copy-and-filter">
<sequential>
<copy tofile="to.txt" file="from.txt" overwrite="true">
<filterset recurse="true">
<filtersfile file="filters.properties"/>
</filterset>
</copy>
</sequential>
</macrodef>
<target name="assemble">
<copy-and-filter />
</target>
</project>
这些文件:
from.txt:
I want my broker to be: @[email protected]
and my client to be: @[email protected]
filters.properties:
myval=fish
[email protected]@-
[email protected]@[email protected]@
我得到的输出为:
i want my broker to be: -fish-
and my client to be: myval
,而不是我所期待这将是这样的:
i want my broker to be: -fish-
and my client to be: fish-fish
如果我设置递归为false然后我得到了“正确”的行为。
i want my broker to be: [email protected]@-
and my client to be: @[email protected]@[email protected]
这是为什么?
该代码适用于您想要的更高版本的Ant。这里有一个Ant错误:https://issues.apache.org/bugzilla/show_bug.cgi?id = 44226它似乎在1.8.0和1.81固定。 – 2011-02-03 14:14:50