Ant判断操作系统
http://blog.csdn.net/zhaofsh/article/details/6104476
<?xml version="1.0"?> <!-- Ant Ant build script that demonstrates how to test to see which operating system (computer platform) the Ant build script is currently running on. Currently tests for Mac OS X, Windows, and Unix systems. Created by Alvin Alexander, DevDaily.com --> <project default="OS-TEST" name="Ant Operating System Test" > <!-- set the operating system test properties --> <condition property="isMac"> <os family="mac" /> </condition> <condition property="isWindows"> <os family="windows" /> </condition> <condition property="isUnix"> <os family="unix" /> </condition> <!-- define the operating system specific targets --> <target name="doMac" if="isMac"> <echo message="Came into the Mac target" /> <!-- do whatever you want to do here for Mac systems --> </target> <target name="doWindows" if="isWindows"> <echo message="Came into the Windows target" /> </target> <target name="doUnix" if="isUnix"> <echo message="Came into the Unix target" /> </target> <!-- define our main/default target --> <target name="OS-TEST" depends="doMac, doWindows, doUnix"> <echo message="Running OS-TEST target" /> </target> </project>
相关推荐
BitsPlayer 2020-05-29
roygbip 2020-02-16
BitsPlayer 2020-02-13
lrcoop 2020-02-03
chichichi0 2020-01-06
BitsPlayer 2019-12-19
BitsPlayer 2019-12-14
xueliangEmail 2013-07-22
cailianren 2010-04-15
wugang0 2019-11-09
lustdevil 2011-08-28
evilvoid 2008-04-17
leonranri 2019-11-05
leeccr 2019-10-31
evilvoid 2010-02-02