The name of the property needs to be quoted in your call to property::exists
. So this is it:
<if test="${not property::exists('testprop')}">
<echo message="property doesn't exists... WTF?" />
<!-- don't swear -->
</if>
Update: What does happen in your example? The unquoted property testprop
is replaced by it's value in your call to function property::exists
. So you're in fact probing property test value
(which BTW isn't a valid property name). Check this out:
<target name="test">
<property name="test.value" value="foo" />
<property name="testprop" value="test.value" />
<echo message="property value = ${testprop}" />
<if test="${property::exists(testprop)}">
<echo message="property exists, as it should!" />
</if>
<if test="${not property::exists(testprop)}">
<echo message="property doesn't exists... WTF?" />
</if>
</target>
Output:
[echo] property value = test.value
[echo] property exists, as it should!