ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magesh Umasankar" <umag...@apache.org>
Subject Re: Filtering and FilterChain/ExpandProperties
Date Thu, 11 Jul 2002 14:37:29 GMT
----- 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>

> 
> Thanks,
>   Rick

Cheers,
Magesh

***************************
*  Nil Magnum Nisi Bonum  *
***************************



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