ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Berman <noe...@yahoo.com>
Subject Re: Filtering and FilterChain/ExpandProperties
Date Thu, 11 Jul 2002 21:56:49 GMT
Magesh,

Thanks for your feedback and suggestion.  It's clear
in the code why the substitution is in the order you
chose.  It's not clear that filtersets are on the way
to being deprecated.  I'm glad to know that the
trajectory (i.e. toward filterchains) so that I can
accomodate that in my work upgrading a moderately
complicated build.xml from a locally-hacked ANT of
uncertain pedigree (probably a 1.3 beta but maybe
older).

The <copy>/<move> pair is hardly elegant, but it'll
save me writing a local customization.  If I get time,
I'll consider taking a shot at extending the
ReplaceTokens filter reader and submitting for
consideration.

Cheers,
  Rick

--- Magesh Umasankar <umagesh@apache.org> wrote:
> ----- Original Message ----- 
> From: "Rick Berman" <noer2b@yahoo.com>
> 
> 
> > 
> > My first attempt was as follows:
> >   <copy file="file1" tofile="file2">
> >     <filterset>
> >       <filtersfile file="filters"/>
> >     </filterset>
> >     <filterchain>
> >       <expandproperties/>
> >     </filterchain>
> >   </copy>
> > 
> > However, the ExpandProperties substitutions occur
> > before the filtering token replacement so I end up
> > with ${...} in my file2.
> 
> By the 1.5 design, filterchains get executed
> before filtersets.  I recollect documenting
> this 'somewhere', but am not able to pinpoint
> the location where I did.
> 
> > It seems that the FilterChain way to do this would
> be
> > to:
> > 1) extend the ReplaceTokens FilterChain to have a
> > filtersfile option
> > 2) put the ReplaceTokens filter in the chain
> before
> > ExpandProperties
> > 3) stop using the <filterset>
> 
> <filterset> is in there mainly for backwards 
> compatibility - filterchains and filtersets
> are best used individually though they are
> bandaged to co-exist together.  You summarization
> above is IMO quite reasonable.
> 
> > 
> > Is there something else I should be considering? 
> > Particularly something that is already supported? 
> If
> > not, I'll have a whack at extending the
> ReplaceTokens
> > FilterReader or look for something else to extend.
> 
> What you _can_ do without altering any code
> to get your desired effect is:
> 
>    <copy file="file1" tofile="file1.tmp">
>      <filterset>
>        <filtersfile file="filters"/>
>      </filterset>
>    </copy>
> 
>    <move file="file1.tmp" tofile="file2">
>      <filterchain>
>        <expandproperties/>
>      </filterchain>
>    </copy>


__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

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


Mime
View raw message