#759 property::exists() evaluation issues

0.91-alpha2
open
nobody
Functions (16)
5
2015-01-23
2011-02-01
Lee
No

It appears the property::exists() function is evaluated after the include when attempting to us as a conditional argument to a task. since the idea is to determine if the property exists before using it, I would not have expected this behaviour.
ex1:
<echo message="service name is defined as ${service.name}" if="${property::exists('service.name')}" />
result1:
Property evaluation failed.
Expression: namespace is defined as ${namespace}
^^^^^^^^^
Property 'namespace' has not been set.

ex2:
<fileset id="deployed.assemblies" failonempty="false" basedir="${targetDirectory}">
<include name="**/*${appName}*.dll" if="${property::exists('appName')}"/>
<include name="**/*${appName}*.exe" if="${property::exists('appName')}"/>
<include name="**/*${service.name}*.dll" if="${property::exists('service.name')}"/>
<include name="**/*${service.name}*.exe" if="${property::exists('service.name')}"/>
<include name="**/*${namespace}*.dll" if="${property::exists('namespace')}"/>
<include name="**/*${namespace}*.exe" if="${property::exists('namespace')}"/>
</fileset>

result2:
Property evaluation failed.
Expression: **/*${namespace}*.dll
^^^^^^^^^
Property 'namespace' has not been set.

Discussion