ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Pilz <andre.p...@pcvisit.de>
Subject Re: How to have Dynamic Propert in ant
Date Thu, 10 Jul 2008 10:03:24 GMT
Hello,

interesting problem. No dynamic properties. Following works:

<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="test" default="test">
     <target name="test">
	<!-- Sets the value to the current time -->
         <tstamp>
             <format property="NOW" pattern="MM/dd/yyyy HH:mm:ss"/> 

         </tstamp>
         <echo>${NOW}</echo>
         <echo>waiting 5 seconds</echo>
         <sleep seconds="5"/>
         <tstamp>
	        <format property="THEN" pattern="MM/dd/yyyy HH:mm:ss"/>
         </tstamp>
         <echo>${THEN}</echo>
     </target>
</project>

Cheers,
André

sukanya schrieb:
> Hi,
> 
> Here is the problem I am now facing:
> 
> <project default='init'>
>     
>     <target name='init'>
>             <tstamp>
>                     <format property='TSTAMP' pattern='MM/dd/yyyy HH:MM:SS
> z'/>
>             </tstamp>
>             <echo file='Time-Log.txtl' append='yes'> ${TSTAMP}</echo>
>             <buildnumber file='${builddeployv3.dir}/build.number'/>
>             <echo>ant.version:  '${ant.version}'</echo>
>             <echo>ant.home:  '${ant.home}'</echo>
>             <echo>java.version:  '${java.version}'</echo>
> <echo file='Time-Log.sql' append='yes'> ${TSTAMP}</echo>
>     </target>
> </project>
> 
> Here the time values are added to a file.
> Where the file has the same time value twice. But i need to have different
> time values with a single <tstamp> element and property. How property values
> can be changed dynamically?
> 
> Appreciate your suggestion to solve this problem.
> 
> Thanks,
> Sukanya
> 

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


Mime
View raw message