You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Peter Vogel <pv...@arsin.com> on 2001/06/11 09:18:09 UTC

[patch]outputproperty attribute for

This is to permit things like this:

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

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
gazillion
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
recently 
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="build.host"/>
    ...
</target>

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

-Peter <<outputproperty_patch.txt>>