Ant的 condition task 用于条件判断,如果condition为true, 那么设置property的值,否则不设置property的值。
实例:
1. 如果classpath中同时有 B和C , 那么设置property a:
<condition property="a">
<and> //当and内部的所有条件都是真的时候,它才为真;
<available classname="B"/>//classpath有class B的时候为真;
<available classname="C"/>
</and>
</condition>
2. 设置property a, 如果当前操作系统是MacOS,并且不是MacOS X
<condition property="a">
<and>
<os family="mac"/> //os family的名字为mac
<not>// 表示非
<os family="unix"/>
</not>
</and>
</condition>
注:常用的os family 有如下
windows (for all versions of Microsoft Windows)
dos (for all Microsoft DOS based operating systems including Microsoft Windows and OS/2)
mac (for all Apple Macintosh systems)
unix (for all Unix and Unix-like operating systems)
netware (for Novell NetWare)
os/2 (for OS/2)
tandem (for HP's NonStop Kernel - formerly Tandem)
win9x for Microsoft Windows 95 and 98, ME and CE
winnt for Microsoft Windows NT-based systems, including Windows 2000, XP and successors
z/os for z/OS and OS/390
os/400 for OS/400
openvms for OpenVMS
3. 设置property a , 当os的名字是SunOS,并且风格是sparc的时候。
<condition property="a">
<os name="SunOS" arch="sparc"/>
</condition>
4.
<condition property="scondition">
<istrue value="true"/> //判定字符串"true”是否为
//"true","yes", or "on"中的一个值,是的话就为true。
</condition>
分享到:
相关推荐
sonarqube开发ant插件,sonar-ant-task-2.2.jar ,最新的ant和sonar集成的代码质量检测插件。
ant 任务 jar 包,有些 java 开源项目依赖 sonar-ant-task-2.1.jar 包构建,如 nutch。使用方法,下载后解压为 .jar 文件,复制到 ant/lib/ 目录下即可使用。
sonar-ant-task-2.1.jar.............................
sonar-ant-Task2.1.jar 最新的ant和sonar集成的代码质量检测和发布的核心jar包!测试工具必备!
标签:ant-task-1.3.2.jar.zip,ant,task,1.3.2,jar.zip包下载,依赖包
apache-ant-1.9.16-bin.zip
开发工具 ant-1.9.6开发工具 ant-1.9.6开发工具 ant-1.9.6开发工具 ant-1.9.6开发工具 ant-1.9.6开发工具 ant-1.9.6开发工具 ant-1.9.6开发工具 ant-1.9.6开发工具 ant-1.9.6开发工具 ant-1.9.6开发工具 ant-1.9.6...
apache-ant-1.6.5-bin ant编译
ant.jar,ant-junit.jar,ant-launcher.jar,ant-trax.jar
标签:ant-launcher-1.8.3.jar,ant,launcher,1.8.3,jar包下载,依赖包
开发工具 ant-launcher-1.9.6开发工具 ant-launcher-1.9.6开发工具 ant-launcher-1.9.6开发工具 ant-launcher-1.9.6开发工具 ant-launcher-1.9.6开发工具 ant-launcher-1.9.6开发工具 ant-launcher-1.9.6开发工具 ...
ant中使用jmeter task,需要的“ant-jmeter-1.1.1.jar”jar包 放到ant的classpath下就好了
例如解压到E:\学习类\apache-ant-1.8.2, 2、配置环境变量。在系统环境变量中新建一个ANT_HOME 的变量,值为D:\apache-ant-1.10.1。在path 变量中添加 %ANT_HOME%\bin; 如果没有path变量,则新建一个。 3、验证ant...
apache-ant-1.6.5-bin 具体详细信息察看readme.txt
标签:ant-1.6.5.jar.zip,ant,1.6.5,jar.zip包下载,依赖包
apache-ant-1.9.2-bin.zip
apache-ant-1.10.12-bin.tar.gz
ant 安装包 新版本 可以尝试下 官网版本 apache-ant-1.10.3-bin.zip
有的小伙伴在离线VS2019安装包的时候会遇到一个包下载失败,就是这个apache-ant-1.9.3-bin.zip,下载以后解压,把apache-ant-1.9.3-bin.zip放到VS2019的缓存目录里就可以了。
还在为找不到jar文件烦心吗,不用了到我空间来有你想要的,持续更新。。。 maven-ant-tasks.jar