You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ex...@nokia.com on 2001/12/17 10:00:30 UTC

Setting property values programatically

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.

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

Any ideas?

Thanks,
Mike.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting property values programatically

Posted by Dirk Weigenand <Di...@smb-tec.com>.
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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>