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 16:43:25 GMT
From: "Steve Loughran" <steve_l@iseran.com>

> >
> > <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>
> >
>
> slick
>
> I'd request that there is a filterreader interface that they are all
derived
> of,

The Ant filters have to extend java.io.FilterReader and
implement the interface org.apache.tools.ant.type.Configurable
which will have the method setParameters(Properties);

> and that that if you spec a short name 'ZapLineCommentsFilterReader'
> then there is no need to give the full path.

ok.  How do you want that done?

> I actually did the first pass of the crlf filter as a StreamReader, but it
> didnt work, there were nulls appearing at the end of the string, one for
> every char stripped. So I went to a string to string postprocessor
instead.

I guess you are not setting/using the return value of read(char[]).
It is supposed to provide the number of characters actually
read.  If you go by the array size, that might be a bad idea.

>
> One issue: how do you pass parameters to the filters. Something like a
strip
> line breaks filter needs to know the char to replace it by; the comment
> filter needs them too. Perhaps a
> <param name value> pair is needed there.
>

I was debating within myself to decide if it is the responsibility
of the Ant engine to provide such plugs or if it is the
responsibility of the FilterReader to read the configuration
parameters from, say, a properties file.  But, since, you
seem to prefer that Ant provide mechanisms, I will do so.

Cheers,
Magesh

*************************************************************
*  Optimist: A person who while falling from the            *
*  Eiffel tower says in midway "See I am not injured yet."  *
*************************************************************



--
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