<project name="test-antcall" default="run-tests" basedir=".">
<!-- check os -->
<target name="os">
<!-- if os is unix, the value of is.unix is true -->
<condition property="is.unix">
<os family="unix"/>
</condition>
<!-- if os is windows, the value of is.windows is true -->
<condition property="is.windows">
<os family="windows"/>
</condition>
<echo>
os.name=${os.name}
os.arch=${os.arch}
os.version=${os.version}
is.unix=${is.unix}
is.windows=${is.windows}
</echo>
</target>
<!-- =================================
target: test-on-windows
================================= -->
<target name="test-on-windows" depends="os" if="is.windows"
description="testing on windows">
<echo>Running tests on windows</echo>
</target>
<!-- =================================
target: test-on-linux
================================= -->
<target name="test-on-linux" depends="os" if="is.linux"
description="testing on linux">
<echo>Running tests on linux</echo>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: run-tests
- - - - - - - - - - - - - - - - - -->
<target name="run-tests">
<antcall target="test-on-windows"/>
<antcall target="test-on-linux"/>
</target>
</project>
<!-- check os -->
<target name="os">
<!-- if os is unix, the value of is.unix is true -->
<condition property="is.unix">
<os family="unix"/>
</condition>
<!-- if os is windows, the value of is.windows is true -->
<condition property="is.windows">
<os family="windows"/>
</condition>
<echo>
os.name=${os.name}
os.arch=${os.arch}
os.version=${os.version}
is.unix=${is.unix}
is.windows=${is.windows}
</echo>
</target>
<!-- =================================
target: test-on-windows
================================= -->
<target name="test-on-windows" depends="os" if="is.windows"
description="testing on windows">
<echo>Running tests on windows</echo>
</target>
<!-- =================================
target: test-on-linux
================================= -->
<target name="test-on-linux" depends="os" if="is.linux"
description="testing on linux">
<echo>Running tests on linux</echo>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: run-tests
- - - - - - - - - - - - - - - - - -->
<target name="run-tests">
<antcall target="test-on-windows"/>
<antcall target="test-on-linux"/>
</target>
</project>