使用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