I am trying to assign two different strings to two different variables dependent on two booleans in Ant.
Pseudocode (ish):
if(condition)
if(property1 == null)
property2 = string1;
property3 = string2;
else
property2 = string2;
property3 = string1;
What I've tried is;
<if>
<and>
<not><isset property="property1"/></not>
<istrue value="${condition}" />
</and>
<then>
<property name="property2" value="string1" />
<property name="property3" value="string2" />
</then>
<else>
<property name="property2" value="string2" />
<property name="property3" value="string1" />
</else>
</if>
But i get a null pointer exception for the line containing "<if>
". I can get it to work using <condition property=...>
tags but can only set one property at a time. I tried using <propertyset>
but that wasn't allowed either.
I'm new to ant as you will probably have guessed :).
Gav