• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

question about filter in ANT1.5

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems to me the following sample code doesn't work. I mean original token string won't be replaced.
<filter token="year" value="2000"/>
<copy todir="${dest.dir}" filtering="true">
<fileset dir="${src.dir}"/>
</copy>
using properties file doesn't work either.
<filter filtersfile="deploy_env.properties"/>
Any comments?
Thanks a lot.
Jason
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got mine to work but I did do something a little different than you did.
In mine I had an "includes" too.
Is your token quoted with '@' in your file too?
e.g. in my source file the DEBUG token is defined as @DEBUG@.
Here's my example:

Hope this helped!
Greg
 
Jason Wang
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot. Your post helps. Now my build script works fine.
Jason
 
Author
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to encourage folks to not use Ant's <filter> task, but rather nest a filterset inside the <copy> task. The <filter> task sets up a global filter which cannot be cleared and will be used on all operations where filtering is enabled - and doing it local to each task that needs it provides cleaner control.
 
Greg Ostravich
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the feedback.
Based on your advice I've modified my build:

Thanks again for the feedback -
 
Now I am super curious what sports would be like if we allowed drugs and tiny ads.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic