ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alison Monteith" <>
Subject RE: getting tag from CVS for use in Ant
Date Thu, 04 Nov 2004 01:16:36 GMT
Hi Dominique,

As I said earlier, this works quite well for me, but some of the
developers are complaining about the error message when they try to
build on the HEAD branch.  Is there any way around this?  Ie. something
equivalent to if [ ! -d CVS/Tag ] ?  I've been searching the ant manual
and can't find anything.


-----Original Message-----
From: Dominique Devienne [] 
Sent: Tuesday, November 02, 2004 6:48 PM
To: Ant Users List
Subject: RE: getting tag from CVS for use in Ant

This is how I extract a CVS branch sticky tag. If you use the HEAD
branch, there's no Tag file, the <loadfile> issues a warning (but
doesn't fail), and the tag is defaulted to HEAD by <property>. The
<replaceregex> are there to convert TTTAG_NAME into TAG_NAME. The ^D.*
variant is when you update/checkout by date instead of tag, in which
case I assume HEAD. Someone also submitted a custom task to do this,
which must be in BugZilla somewhere. It didn't go into Ant, partly
because the Ant snippet below is 90% of the solution, albeit longer, and
can be made into a <macrodef> easily. --DD
        <loadfile property="tag" failonerror="false"
<mailto:${modules}/@{name}/CVS/Tag> ">
              <replaceregex pattern="^T" replace="" />
              <replaceregex pattern="^D.*" replace="HEAD" />
        <property name="tag" value="HEAD" />


From: Alison Monteith []
Sent: Tue 11/2/2004 5:39 PM
To: Ant Users List
Subject: getting tag from CVS for use in Ant


I don't know much about ant and am trying to fix a problem in our
existing build.xml file.

We have many branches in CVS and our normal procedue is to checkout out
a module which contains a build.xml file then run an ant package in this
directory which creates our software packages etc.  As part of the build
script a file called release.txt is created which should contain the cvs
tag and date and timestamp. 

Here are the relevant lines from build.xml:

<property name="label" value=${build_num} ${DSTAMP} ${TSTAMP}" />

<exec dir="www"
          <arg line="${label}"/>

Nowhere in build.xml is build_num set, so as expected the output is
"${build_num} <actual date> <actual time>"

Does anyone know how to set a variable (in this case ${build_num}) with
the cvs tag for the current module?

Thanks in advance for any info.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message