----- Original Message ----- From: "Magesh Umasankar" <[EMAIL PROTECTED]> To: "Ant Developers List" <[EMAIL PROTECTED]> Sent: Thursday, February 14, 2002 5:42 PM Subject: Re: LoadFile task
> From: Stefan Bodewig <[EMAIL PROTECTED]> > > > On Mon, 11 Feb 2002, Steve Loughran <[EMAIL PROTECTED]> wrote: > > > From: "Jason van Zyl" <[EMAIL PROTECTED]> > > > > >> 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> > slick I'd request that there is a filterreader interface that they are all derived of, and that that if you spec a short name 'ZapLineCommentsFilterReader' then there is no need to give the full path. 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. 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. > 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. Its a new perspective on filtering; says that a filter is just another plug in. filters, crlf, even property expansion is a form of filtering. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
