ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Weigenand <Dirk.Weigen...@smb-tec.com>
Subject Re: Setting property values programatically
Date Mon, 17 Dec 2001 10:33:57 GMT
Hello Mike,

Ext-Mike.Hogan@nokia.com schrieb:
> 
> Hi,
> 
> Is there a way to set the value of a property programatically, similar to
> this piece of shell code:
> 
> SET VALUE=`execute some command`
> 
> I want to create a build number and store it in a property for propagation
> across a few ant tasks.
> 

  <target name="build">
    <propertyfile file="buildnumber">
      <entry key="buildnumber" type="int" default="0" operation="+" />
    </propertyfile>
    <property file="buildnumber" />
    <echo message="buildnumber: ${buildnumber}" />
  </target>

The above will read in the property file 'buildnumber' and increment the
value
of the property 'buildnumber' by one.

This value is then save to the property file.


> Failing this, is there a way to instruct ant to reload any properties that
> are loaded from external files?
> 
> Any ideas?

Dirk
-- 
_____________________________________________________________________
Dirk Weigenand                      mailto:Dirk.Weigenand@smb-tec.com
SMB GmbH                                       http://www.smb-tec.com

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