> <if test="${ccnet.buildcondition}='ForceBuild'">
>            <property name="build" value="rebuild"/>
> </if>

The problem here is that test is expecting a boolean value (true or
false). The documentation says it is expecting a string... This should
be fixed.

You can place either true or false as the test attribute value or an
expression that will evaluate to true or false.

In you example above you have "${ccnet.buildcondition}='ForceBuild'"
which will generate "ForceBuild='ForceBuild'" assuming that
ccnet.buildcondition is set to "ForceBuild".

If you know that ccnet.buildcondition will always exist then you can use
the following:

<if test="${ccnet.buildcondition=='ForceBuild'}">
  <property name="build" value="rebuild" />
</if>

If you don't know whether it will exist then you want to do something
like this to check for existence first:

<if test="${property::exists('ccnet.buildcondition') and
ccnet.buildcondition=='ForceBuild'}">
  <property name="build" value="rebuild" />
</if>

An alternative to using the <if> task is to use the 'if' attribute in
the <property> task itself:

<property name="build" value="rebuild"
if="${property::exists('ccnet.buildcondition') and
ccnet.buildcondition=='ForceBuild'}" />

I hope this clarifies the why as well as the how.

Oh, although the documentation does not mention it explicitly yet (or at
all) you must use '==' to test for equality now and not '='. You get a
nice error (or deprecated warning) that alerts you to this.

--Edwin


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to