<project name="java-ant project" default="run">
<target name="compile">
<available property="file.exists" file="some-file"/>
<echo>File is compiled</echo>
</target>
<target name="run" depends="compile" if="file.exists">
<echo>File is executed</echo>
</target>
</project>
<project name="java-ant project" default="run">
<target name="compile" unless="file.exists">
<available property="file.exists" file="some-file"/>
</target>
<target name="run" depends="compile" if="${file.exists}">
<echo>File is executed</echo>
</target>
</project>