NAnt IF 任务似乎不起作用
我正在尝试 if 任务的 NAnt 文档中的示例:
http://nant.sourceforge.net/release/0.85/help/tasks/if.html
具体来说,以下代码...
<if test="${build.configuration='release'}">
<echo>Build release configuration</echo>
</if>
其中 build.configuration 已预先定义为
<property name="build.configuration" value="debug" overwrite="false" />
当我使用 nant.exe(版本 0.91.3881.0) 运行它时,我收到以下错误:
'}' expected
Expression: ${build.configuration='release'}
^
我猜我缺少一些简单的东西吗?
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:
'}' expected
Expression: ${build.configuration='release'}
^
I'm guessing I'm missing something simple?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要根据您的网页将
=
符号加倍。编程时,在大多数语言中,
=
是赋值运算符,而==
是布尔比较运算符。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.也许应该更改 NAnt 参考...
查看手册。
Maybe the NAnt reference should be changed then....
See the manual.