ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magesh Umasankar" <umag...@apache.org>
Subject Re: LoadFile task
Date Fri, 15 Feb 2002 01:42:05 GMT
From: Stefan Bodewig <bodewig@apache.org>

> On Mon, 11 Feb 2002, Steve Loughran <steve_l@iseran.com> wrote:
> > From: "Jason van Zyl" <jvanzyl@zenplex.com>
>
> >> 1) I would like to be able to filter out comment, so would it be >
> >> acceptable to add a property that sets comment line
> >> characteristics:
> >>
> >> <loadfile comments="#,--"/>
>
> +1

I am working on creating this in a more generic
way and I don't like comments="#,-" approach very
much...

<loadfile property="t" srcFile="d:\temp\build4.xml">
    <filterreaderset>
        <filterrdr
classname="org.apache.tools.ant.filters.ZapCommentsFilterReader"/>
        <filterrdr
classname="org.apache.tools.ant.filters.StripLineBreaksFilterReader"/>
    </filterreaderset>
</loadfile>

We can then do away with makeoneline attribute as well.

In the above example, the file contents would
be passed through the ZapCommentsFIlterReader
to remove all the commented lines and then that will
be passed to the StripLineBreaksFilterReader
which will convert that into a single line.  User can then
be able to attach a multitude of filters.  Moreover,
we can look at introducing similar things to <copy>,
<move>, etc.

What do you think?

>
> > Maybe the attr should be 'lineComments' to enable someone else to
> > filter out /* */, (* *) and the like, which is a much harder
> > proposition.
>
> +1 as well.

We can come up with a ZapNestedCommentsFilterReader as well.

>
> Stefan
>

Cheers,
Magesh



--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message