ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject RE: condition in 1.3
Date Thu, 06 Sep 2001 18:49:58 GMT
--- "Zanabria, Moises" <> wrote:
> I made a build.xml with different targets names, i.e. release build,
> daily build or default build , I call my ant script with:
> ant -Dtag="%TAG%" 
> The target name depend on $TAG value, so I would like to compare the
> $TAG value with tag values in my build.xml.
> Diane could you please more extensive in this part, I'll really
> appreciate.
> >>you could try seeing whether it relies on anything else that's
> >>changed, and if doesn't, you could just pick it up and add it to
> >>your 1.3.

Sorry, but I just tried adding the <condition> task to my 1.3, and it
turns out it depends on lots of other changes to 1.4, so that's not going
to be an option for you afterall (but given what you're asking to do, I
don't think the <condition> task would've saved you all that much anyway).
For 1.3, you can do something like the following (just a skeleton

<project name="projname" default="build" basedir=".">
  <property name="${tag}.build" value="true"/>
  <target name="build" depends="release, daily, default"/>
  <target name="release" if="">
    <echo message="Running release build..."/>
  <target name="daily" if="">
    <echo message="Running daily build..."/>
  <target name="default" if="">
    <echo message="Running default build..."/>

Then run:

$ ant -Dtag=release     # or build or default

I'd also recommend you run with as
your logger, so you don't get the targets that don't run printing out as
well (personally, I think NoBannerLogger should be the default logger).
Instead of typing all that every time you run 'ant', you can stick it in
an env var and then just reference that var on the command-line (eg.,
export ANT_ARGS="-logger", then run
'ant -Dtag=release $ANT_ARGS'). (Hmm, come to think of it, maybe I should
put a change through on the wrapper scripts to pass a $ANT_ARGS.)
Hope this helps,


Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger

View raw message