Source Code : Condition for file change

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Condition for file change

<?xml version="1.0"?>

<project name="Apache Ant Properties Project" default="compile" basedir=".">

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

  <property name="jstl.src" value="jstl"/>
  <property name="jstl.jar" value="jstl.jar"/>  
  
  <condition property="jstl.src.exists">
    <available file="${jstl.src}" filepath="./src"/>
  </condition>

  <condition property="jstl.jar.exists">
    <available file="${jstl.jar}" filepath="./lib"/>
  </condition>

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

  <target name="checkout-jstl" unless="jstl.src.exists">
    <echo message="Checking out ${jstl.jar}"/>
  </target>

  <target name="build-jstl" depends="checkout-jstl" unless="jstl.jar.exists">
    <echo message="Building ${jstl.jar}"/>
  </target>

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

 
  <condition property="is.fileset">
    <isreference refid="uptodate.id" type="fileset"/>
  </condition>

  <target name="fileset-prepare">
    <echo message="Value of is.fileset = ${is.fileset}"/>
  </target>




</project>

           
       

Thank with us