Is there a reason why we can't use the <available /> task as a <property/> definiton ?
I mean, this works : <?xml version="1.0"?>
<project basedir=".." default="echo" name="TestsForCustomer"> <!-- Prefixes all the environment properties with the --> <!-- 'env.' string --> <property environment="env" />
<!-- Only the properties located in this file can be modified --> <!-- to customize --> <!-- some values to your environment --> <property resource="local.properties" />
<target name="echo"> <!-- Verifies if some libraries are present in the CLASSPATH --> <available classname="org.aspectj.tools.ajbrowser.Main" property="compiler.inClasspath" /> <echo>Value for : root directory : ${root.dir} .. scripts ... : ${scripts.dir} scripts.lib.dir : ${scripts.lib.dir} lib.dir : ${lib.dir} aspect compiler in the CLASSPATH : ${compiler.inClasspath} </echo> </target> </project>
while this doesn't
<?xml version="1.0"?>
<project basedir=".." default="echo" name="TestsForCustomer"> <!-- Prefixes all the environment properties with the --> <!-- 'env.' string --> <property environment="env" />
<!-- Only the properties located in this file can be modified --> <!-- to customize --> <!-- some values to your environment --> <property resource="local.properties" /> <!-- Verifies if some libraries are present in the CLASSPATH --> <available classname="org.aspectj.tools.ajbrowser.Main" property="compiler.inClasspath" />
<target name="echo"> <echo>Value for : root directory : ${root.dir} .. scripts ... : ${scripts.dir} scripts.lib.dir : ${scripts.lib.dir} lib.dir : ${lib.dir} aspect compiler in the CLASSPATH : ${compiler.inClasspath} </echo> </target> </project>
Thanks for explaination of why the second option is not logical.