Java Tutorial/Ant/Existance Check
Check existance of source code
<?xml version="1.0"?>
<project name="Apache Ant Properties Project" basedir=".">
<property name="jstl.src" value="jstl"/>
<condition property="jstl.src.exists">
<available file="${jstl.src}" filepath="./src"/>
</condition>
<target name="checkout-jstl" unless="jstl.src.exists">
<echo message="Checking out ${jstl.jar}"/>
</target>
</project>
Check jar file existance
<?xml version="1.0"?>
<project name="Apache Ant Properties Project" basedir=".">
<property name="jstl.jar" value="jstl.jar"/>
<condition property="jstl.jar.exists">
<available file="${jstl.jar}" filepath="./lib"/>
</condition>
<target name="build-jstl" depends="checkout-jstl" unless="jstl.jar.exists">
<echo message="Building ${jstl.jar}"/>
</target>
</project>