check os

来源:互联网 发布:avmo最新域名 编辑:程序博客网 时间:2024/05/01 06:37
<project name="os" default="os" 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>
</project>
原创粉丝点击