Compile if upto date : Condition « Ant « Java Tutorial






<?xml version="1.0"?>
<project name="Apache Ant Properties Project" basedir=".">
  

  <fileset dir="." id="uptodate.id">
    <include name="src/jstl/One.java"/>
  </fileset>

  <condition property="uptodate">
    <uptodate>
      <srcfiles refid="uptodate.id"/>
      <mapper type="merge" to="./One.java"/>
    </uptodate>
  </condition>

  <target name="compile" if="uptodate">
    <echo message="File changed: ${uptodate}"/>
  </target>


</project>








38.8.Condition
38.8.1.Check condition
38.8.2.Compile if upto date
38.8.3.Condition properties
38.8.4.or condition with containsregexp
38.8.5.and condition in fileset