ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: setting var's in a property file
Date Tue, 02 Sep 2003 07:02:26 GMT
Simplest solution is defining that property after setting ${now}.
Inside a property file:  root=//some//directory//${now}
or inside the build file:  <property name="root"
value="//some//directory//${now}"/>

<project>
    <property name="now" value="1-2-3"/>
    <property name="root" value="//some//directory//${now}"/>
    <echo>${root}</echo>
    <echo file="root.properties">root=${root}</echo>
</project>

prints 
     [echo] //some//directory//1-2-3


And you´ll get a properties file "root.properties" for later use :-)




Jan


> -----Original Message-----
> From: Dhaval Chokshi [mailto:dhavalchokshi@elitecore.com]
> Sent: Tuesday, September 02, 2003 8:37 AM
> To: Ant Users List
> Subject: Re: setting var's in a property file
> 
> 
> You can make one dummy file with the tag @build-tag@ in your 
> file. Then in
> your ant you can copy that file to your property file with 
> the filter set
> option like,
> 
>   <copy todir="XYZ" file="PROPERTYFILE">
>          <filterset>
>             <filter token="build-tag" value="${now}" />
>          </filterset>
>       </copy>
> 
> Dhaval Chokshi
> Jr. Software Engineer
> Elitecore Technologies Ltd.
> _____________________________________________________________________
> 
> Work as if you were to die tomorrow. Learn as if you were to 
> live forever.
> -- Mahatma Gandhi
> 
> 
> ----- Original Message -----
> From: "Yevgeni Kovelman" <ykovelman@telabout.com>
> To: <user@ant.apache.org>
> Sent: Thursday, August 28, 2003 10:53 PM
> Subject: setting var's in a property file
> 
> 
> > Hello,
> >
> > I have a standard java property file of type key=value 
> included in my
> > build.  There is a variable that I would like to set in 
> that property
> > file during the ant build process.
> >
> > For example:
> >
> > root=//some//directory//{build-tag}
> >
> > I have a variable $now  defined in my build script, during 
> the build I
> > would like to replace {build-tag} with $now.  Is there 
> anyway to do that
> > ?
> >
> > Thanks,
> > Yev
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message