ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Will Dyke <will.d...@bbc.co.uk>
Subject RE: How to check if a propery is set
Date Mon, 15 Oct 2001 12:37:54 GMT
if=${test.id} tests whether test.id is
set to anything, not just "true". The
unless check will succeed only if test.id
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 test.id is set
to a particular value, you'll need to use the
condition task, together with the equals
nested element. 

Will

> -----Original Message-----
> From: Sebastien Chassande-Barrioz
> [mailto:sebastien.chassande@inrialpes.fr]
> 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 test.id 
> variable is not 
> set to the "true" value, but it's set to my test identifier.
> 
> <target name="test1" if="${test.id}">
> ....
> </target>
> <target name="test2" unless="${test.id}">
> ....
> </target>
> 
> Do you have a suggestion to resolve my problem ?
> 
> Thanks,
> Seb
> -- 
> Chassande-Barrioz Sebastien
> INRIALPES - SIRAC/SARDES Team - ObjectWeb initiative
> Mail job : sebastien.chassande@inrialpes.fr
> Phone : 04.76.61.55.16
> 


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.

Mime
View raw message