The property name must be specified in your call to property::exists . So here it is:
<if test="${not property::exists('testprop')}"> <echo message="property doesn't exists... WTF?" /> <!-- don't swear --> </if>
Update: What happens in your example? The testprop property testprop is replaced by the value in your function property::exists function call. So you are actually investigating the test value property (that BTW is not a valid property name). Check this:
<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!
source share