ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: [PATCH] - Added if and unless attributes
Date Mon, 25 Sep 2000 22:42:26 GMT
--- Stefan Bodewig <> wrote:
>  DH> I have a need to test if a property is set "true" or "false".
> How does the property get its value?

It gets set by a user env var -- it's used as a filter token replacement
value for a template file that gen's a .java file. It replaces a token
that stands in for a boolean value (hence: true|false). It's a boolean
used for turning on/off debug code -- in other words, the java equivalent
of #ifdef DEBUG :) And I wanted to be able to check the value in order to
make a decision about what the output dir should be (ie., to allow the
same source-tree to be compiled into two different output dirs -- one
where the source has been compiled with debug available, the other
without). I could diddle the output dir setting at the wrapper-script
level, but I didn't think I could using <ant> (which I'd wanted to use in
an auto-build that builds both flavors).

But it's all become academic, because of a message I've only just now
gotten around to receiving (which can't be explained by any logic, since
it's from back in August). It was sent to the user list by David Weller --
the *hopefully soon to be* immortalized author of the "Ant for Mortals"
doc. (David? - hullo?) The message is in the August archive:
It shows an example of re-setting a property value using <ant> -- which I
swear I *tried* to use before, but couldn't get it to work (so I did this
horribly hacky workaround, where I <exec> 'sh' with 'ant -D...' args -- I
know, I know -- yuk!) Anyway, I've lifted his example, slotted my stuff
into it, resetting not only the debug property but the output dir property
as well, and it works like a champ. Go figure.

So (once again :), I withdraw my request for something special just for



Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.

View raw message