ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: test if exists
Date Thu, 09 Jul 2009 07:54:13 GMT
>ant -Dpropname=xxx // correct usage
>ant // incorrect usage of my build
>Can I test a property existence?
>if propname not exists (
>   echo "Give more command line arg"
>   exit ant running

You could check that with the <isset> condition.
In that case you would combine it with fail:

  Give more command line arg
    <isset property="propname"/>

If you can work with default values you can easily set that:
  <property name="propname" value="defaultvalue"/>

Because Ant properties are immutable (once set they cant be changed)
Ant will use the user value (from the command line) if given, otherwise
the default.

For an introduction have a look at the tutorial


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

View raw message