Check condition : Condition « Ant « Java Tutorial






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

  <condition property="is.windows">
    <os family="windows"/>
  </condition>

  <condition property="is.unix">
    <os family="unix"/>
  </condition>

  <target name="do-windows" if="is.windows">
    <echo message="This is Windows"/>
  </target>

  <target name="do-unix" if="is.unix">
    <echo message="This is Unix"/>
  </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