antcall

来源:互联网 发布:新丰县网络问政 编辑:程序博客网 时间:2024/04/27 21:21
<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>

原创粉丝点击