2013-06-24 116 views
0

我想在某些条件满足时做某些事情,但似乎在某处我的语法错误。我需要有三个if条件才能完成一件事,但我不知道如何输入if之一的语句。Nant嵌套如果条件

<if test="${build.MoniXXXtor == 'true'} or test="${build.XXX== 'true'}" or test="${build.yyy== 'true'}"> 
    <property name="solutionFile" value="${svn.Lib.path}"/> 
    <property name="LocalPath" value="${Local.Lib.path}"/> 
    <call target="getLatest" if="${source.getLatest == 'true'}"/> 
</if> 

看起来上面的OR条件的语法是错误的。

回答

0

the documentation,你应该只使用一个等号(=的==代替),例如:

<if test="${build.configuration='release'}"> 
    <echo>Build release configuration</echo> 
</if> 
+0

如果条件在同一行,你如何指定一个。 – user1248327

+0

你如何指定一个更多的条件? – user1248327

+0

@ user1248327:你点了链接吗?看看第二个例子。 – M4N

0

假设build.MoniXXXtor,build.XXX和build.yyy是布尔属性代码只是:

<if test="${build.MoniXXXtor or build.XXX or build.yyy}"> 

如果它们是串的属性,它们需要被转换为布尔值:

<if test="${convert::to-boolean(build.MoniXXXtor) or 
      convert::to-boolean(build.XXX) or 
      convert::to-boolean(build.yyy)}">