Boolean checks are done this way:
 
<sometask if="${propertyName='string_value'}" />
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Bart Read
Sent: Friday, October 15, 2004 8:57 AM
To: [EMAIL PROTECTED]
Subject: [Nant-users] Boolean evaluation

Hi All,
 
 
I'm afraid I'm scratching my head a bit with this one.  I want to use a boolean check (if or unless, and sometimes the if task) to conditionally execute a task based on the value of a property.
 
So I want to be able to do something like:
 
<sometask if="${propertyName}=string_value"/>
 
etc.
 
I've tried about half a dozen ways of writing this and every time I get a build error saying something like the following:
 
 Cannot resolve expanded value '"4"=="UNKNOWN BUILD NUMBER"' of 'unless' attribute to a Boolean value.
 
(derived from unless="&#34;${label-to-apply}&#34;==&#34;UNKNOWN BUILD NUMBER&#34;")
 
I've read the documentation but unfortunately it's fairly opaque on this point.  I've tried using single-quotes, double quotes (as &#34;), no quotes, single equals, double-equals etc in various combinations but all to no avail.  This is seriously driving me up the wall at the moment.
 
Anybody know anything about this?  I'd be very grateful for any assistance.
 
 
Many thanks,
Bart
 
 
 
======================
Bart Read
Software Engineer
Red Gate Software Ltd
+44 (0) 870 160 0037 ext 31
======================
 

Reply via email to