Ant FilterSet

本文介绍Ant构建工具中Filterset的功能及使用方法,包括属性配置、示例代码等,帮助读者理解如何利用Filterset进行文件复制过程中的文本替换。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

Attribute Description Default Required
begintokenThe string marking the beginning of a token (eg., @DATE@ ).@No
endtokenThe string marking the end of a token (eg., @DATE@ ).@No
filtersfileSpecify a single filtersfile.none No
recurseIndicates whether the replacement text of tokens should be searched for more tokens. Since Ant 1.6.3 true No
onmissingfiltersfileIndicate behavior when a nonexistent filtersfile is specified. One of "fail", "warn", "ignore". Since Ant 1.7 "fail"No

Filter

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

Filtersfile

Attribute Description Required
fileA 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.





评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

惹不起的程咬金

来都来了,不赏点银子么

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值