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>