https://bz.apache.org/bugzilla/show_bug.cgi?id=62313
Bug ID: 62313
Summary: LoadProperties + LineContains filter automatically
defaults to AND operation
Product: Ant
Version: 1.10.3
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Core tasks
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 35883
--> https://bz.apache.org/bugzilla/attachment.cgi?id=35883&action=edit
sample build script and property file
This is based on the discussion in the Ant User list[1] wherein it is not
immediately apparent in the documentation that specifying multiple LineContains
entries in the FilterChain used in the LoadProperties task meant that all
entries are being searched inclusively.
Instead of relying on LineContainsRegexp filter, can the LineContains filter be
enhanced to support "OR" operations so that users can use something like
<filterchain>
<linecontains>
<contains value="xws.user" />
<contains value="xws.password" />
<contains value="wl.user" />
<contains value="wl.password" />
</linecontains>
</filterchain>
instead of
<filterchain>
<linecontainsregexp>
<regexp pattern=".*w[sl]\.[(user|password)]*" />
</linecontainsregexp>
</filterchain>
?
The latter looks elegant but can get pretty complex if there are less
similarities on the properties that the user wants to read in one go. Since
LoadProperties seem to combine all contained filterchains the other feasible
option I can think of is to do sequential load of the same property file with
different contained filterchains which increases the length of the build file.
[1]
https://mail-archives.apache.org/mod_mbox/ant-user/201804.mbox/%3CCAH5zQ53qhVdjmbO1xF-xEd26qhOu5GiwQbXDEVY14JC34k83nQ%40mail.gmail.com%3E
--
You are receiving this mail because:
You are the assignee for the bug.