ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Will Dyke <>
Subject RE: How to check if a propery is set
Date Mon, 15 Oct 2001 12:37:54 GMT
if=${} tests whether is
set to anything, not just "true". The
unless check will succeed only if
is not set. 

Therefore, if I understand your email correctly,
your tests should work as you intend. Running
ant with -debug shows which of the tasks run,
which should help you verify what's going on.

If you wish to check whether is set
to a particular value, you'll need to use the
condition task, together with the equals
nested element. 


> -----Original Message-----
> From: Sebastien Chassande-Barrioz
> []
> Sent: 15 October 2001 13:43
> To: ant-user
> Subject: How to check if a propery is set
> hi,
> I would like to run tasks only if a certain variable is set or not.
> The following example doesn't work because the 
> variable is not 
> set to the "true" value, but it's set to my test identifier.
> <target name="test1" if="${}">
> ....
> </target>
> <target name="test2" unless="${}">
> ....
> </target>
> Do you have a suggestion to resolve my problem ?
> Thanks,
> Seb
> -- 
> Chassande-Barrioz Sebastien
> INRIALPES - SIRAC/SARDES Team - ObjectWeb initiative
> Mail job :
> Phone :

This e-mail, and any attachment, is confidential. If you have received
it in error, please delete it from your system, do not use or disclose
the information in any way, and notify me immediately. The contents of
this message may contain personal views which are not the views of the
BBC, unless specifically stated.

View raw message