关闭

Ant FilterSet

标签: anttokendatefilterpropertiesstring
2229人阅读 评论(2) 收藏 举报
分类:

FilterSet是一组Filter的集合,那什么是Filter,这个词英文的意思是过滤。Filtersets are used for doing replacements in tasks such as <copy> , etc.

Attribute Description Default Required
begintoken The string marking the beginning of a token (eg., @DATE@ ). @ No
endtoken The string marking the end of a token (eg., @DATE@ ). @ No
filtersfile Specify a single filtersfile. none No
recurse Indicates whether the replacement text of tokens should be searched for more tokens. Since Ant 1.6.3 true No
onmissingfiltersfile Indicate behavior when a nonexistent filtersfile is specified. One of "fail", "warn", "ignore". Since Ant 1.7 "fail" No

Filter

Attribute Description Required
token The token to replace (eg., @DATE@ ) Yes
value The value to replace it with (eg., Thursday, April 26, 2001 ). Yes

Filtersfile

Attribute Description Required
file A properties file of name-value pairs from which to load the tokens. Yes

 

看个例子:

<copy file="${build.dir}/version.txt" toFile="${dist.dir}/version.txt">

<filterset begintoken="%" endtoken="*">

<filter token="DATE" value="${TODAY}"/>

</filterset>

</copy>

copying the version.txt

file to the dist
directory from the build directory but wish to replace the token %DATE*
with today's date.





0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:2170300次
    • 积分:21887
    • 等级:
    • 排名:第353名
    • 原创:372篇
    • 转载:317篇
    • 译文:1篇
    • 评论:146条
    最新评论