I've got an NAnt <exec>
task. I want one argument presence to be conditional to some property being true
.
For example, I want the -c
command line argument of psExec to be conditional. It should be outputted only if ${pExec.copyprog == 'true'}
.
The following does not work:
<property name="psExec.copyprog" value="false" />
...
<exec program="${psExec.path}" failonerror="false">
...
<arg line="-c" if="${psExec.copyprog}==true" />
</exec>
It yields the following error:
'false==true' is not a valid value for attribute 'if' of <arg ... />.
Cannot resolve 'false==true' to boolean value.
String was not recognized as a valid Boolean.
How can I achieve this?