Specify condition : Condition « Ant « Java






Specify condition

<?xml version="1.0"?>

<project name="Apache Ant Properties Project" default="do-windows" 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>

           
       








AntBasicTags.zip( 2 k)

Related examples in the same category

1.Target based on condition
2.Condition for file change