ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Filters and token values
Date Fri, 04 May 2001 20:20:50 GMT
--- "M.A.Dunphy" <madunphy@bigfoot.com> wrote:
> When you setup filter tokens via a filterfile, is it possible to access
> a token and it's value as if it was a property. This if I had this in
> the file:
> 
> VERSION =1.0
> 
> Then could I reference it like ${ant.token.VERSION}
> 
> Doing it this way, the file drives the whole process. I know I could use
> a standard properties file and thus would get properties, but then I'd
> have to explicitly code the <filter token value>

Maybe I'm not understanding what you need to do (since I can't think of
why you'd need to reference a filter-token). You can use the same file for
both filters and properties. Just read the file in twice -- once using
<property> and again using <filter>. Eg., put those tasks in an "init"
target:

  <target name="init">
    <property file="build.properties"/>
    <filter filtersfile="build.properties"/>
  </target>

Now, any filtered copying you do, just set filtering="true" (or yes|on),
and you should be good to go, without having to do any addition <filter>
tasks, and you can still reference things as normal properties where you
need to.

Diane


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Mime
View raw message