ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Vogel <>
Subject [patch]outputproperty attribute for <exec>
Date Mon, 11 Jun 2001 07:18:09 GMT
This is to permit things like this:

<target name="init"> 
    <exec executable="cleartool" outputproperty="buildnum">
        <arg line="describe -aattr buildnum ${ant.file}"/>

Which allows me to fetch (and even potentially fetch+set) the buildnum 
attribute on the build.xml file, which saves me from having to create a
versions of a file just to update the build number with each build, and to 
ensure that the build number is stored in the source tree.

With CVS, I do the same thing by looking at the tags and finding the latest
(highest) build number tag.

There are lots of other potential uses for this sort of thing, someone
asked on this list or the ant-user list how to get the name of the host on
which they were running ant:

<target name="init">
    <exec executable="hostname" outputproperty=""/>

Since hostname is available just about anywhere, but environment variables
differ from OS to OS in how they encode (or even if they encode) the 

-Peter <<outputproperty_patch.txt>> 

View raw message