ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: random null directory?
Date Wed, 20 Sep 2000 19:16:06 GMT
--- Wes Moulder <wmoulder@axyssolutions.com> wrote:
> I want to know if it's possible to make it fail if a variable is not set
> (set to "null")?

If by "it" you mean ant, the answer is: Not at this time. If you pass a
property in like "-Dfooproperty=$FOO", then test in ant with the construct
if="fooproperty", the test will pass, even if $FOO in the environment
wasn't set to anything.

What I do (now that I know this) is to have my wrapper-script do the
test-for-set, and only pass in properties-set-by-env-vars that have env
vars that are in fact set. (Wow, that's much harder to say than it is to
script :)  Eg.:

[ "$FOO" ] && setfooproperty="-Dfooproperty=$FOO"

The java call to ant (in the wrapper-script) just always includes
$setfooproperty -- if it's set to something, then that gets passed in, and
if it's not, it's just a blank space on the command-line.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

Mime
View raw message