I'm trying the example from the NAnt documentation for the if task at:
http://nant.sourceforge.net/release/0.85/help/tasks/if.html
Specifically the following code...
<if test="${build.configuration='release'}">
<echo>Build release configuration</echo>
</if>
where build.configuration has been defined beforehand as
<property name="build.configuration" value="debug" overwrite="false" />
When I run it using nant.exe (version 0.91.3881.0), I get the following error:
'}' e开发者_如何学运维xpected
Expression: ${build.configuration='release'}
^
I'm guessing I'm missing something simple?
You need to double the =
symbol as per your web page.
When programming, =
is an assignment operator in most languages, whereas ==
is the boolean comparison operator.
Maybe the NAnt reference should be changed then....
<if test="${build.configuration='release'}">
<echo>Build release configuration</echo>
</if>
See the manual.
精彩评论