ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Blaukopf <Daniel.Blauk...@Sun.COM>
Subject Would like to contribute some Ant modifications - how?
Date Thu, 19 Oct 2006 23:53:04 GMT

I have some Ant changes that I'd like to put forward for possible
inclusion in future versions of Ant. These changes are all aimed at
making it easier to process file paths and text in various ways.

1. "mapperfilter", a ChainableFilterReader that complements
"filtermapper". Whereas "filtermapper" allows file paths to be treated
as arbitrary text and manipulated by text filters, "mapperfilter" allows
arbitrary text to be treated as file paths and manipulated by mappers.
For example,
        <globmapper from="*.java" to="*.class"/>

2. "subpathmapper", a Mapper for conceptually splitting up file paths
into their constituent directory and file name elements and selecting a
sequence of those elements. For example, selecting only the directory
part of a filename.

The above two changes are primarily aimed at reducing the need to use
regular expressions to process filenames.

3. Nested FilterChains in the property task. Currently, in order to take
the value of one property and process it into a different property,
there are two ways:

i) Use "pathconvert" and mappers - only appropriate for file and path values
ii) Write the property to a file and read it in with FilterChains.

The use of the file in the second instance can be avoided by the use of
FilterChains when setting the value of a property. For example:

<!-- versionstring has the following multi-line value:

Product: Widget
Version: 0.01
<property name="htmlversionstring" value="${versionstring}>

        <prefixlines prefix="&lt;br&gt;"/>

The changes needed for the above features are fairly small. I attach a
patch, including some tests and documentation changes.

Is this of any interest? Are these changes in line with Ant philosophy?



View raw message