当前位置:网站首页>ant使用总结(二):相关命令说明
ant使用总结(二):相关命令说明
2022-06-23 04:21:00 【linchaolong】
在ant安装目录的manual目录是ant的说明文档,打开index.xml,点击Using Apache ant有使用说明。
相关命令说明
指定配置文件
project
target
property
import
condition
<property name="a" value="aaa" />
<!--
<property name="b" value="bbb" />
-->
<!-- 如果设置了属性b则值为${b},否则值为${a}-->
<condition property="val" value="${b}" else="${a}">
<!-- 判断是否设置了指定属性 -->
<isset property="b" />
</condition>propertyfile
<propertyfile file="auto.prop">
<!-- 保存auto.umeng.channel=${a}到文件 -->
<entry key="auto.umeng.channel" value="${a}" />
</propertyfile>copy
delete
move
javac
java
<classpath>
<pathelement location="xxx.jar" />
<pathelement path="classpath" />
</classpath>
</java>
jar
if
<!-- 如果条件成立,则调用print -->
<if>
<!-- 判断指定属性值是否为true -->
<!--
<istrue value="${a}" />
-->
<!-- 判断是否设置了指定属性 -->
<!--
<isset property="prop"/>
-->
<!-- 判断两个值是否相等 -->
<equals arg1="${channel}" arg2="2" />
<then>
<antcall target="print" />
</then>
</if>script
<script language="javascript">
<![CDATA[
project.setProperty("time",Math.floor((new Date()).getTime()/1000));
]]>
</script>时间戳
<tstamp>
<format property="time"
pattern="yy.M.d.HHmm" />
</tstamp>添加自定义jar到ant的classpath
<!-- 添加ant-contrib-1.0b3.jar到classpath -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${env.ANT_ROOT}\lib\ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>ant中实现迭代
下载ant-contrib,并将ant-contrib-1.0b3.jar文件拷贝至ANT安装目录。
下载地址:
channel = ${channel}

替换指定字符串
| < | < | 小于号 |
| > | > | 大于号 |
| & | & | 和 |
| ' | ' | 单引号 |
| " | " | 双引号 |
边栏推荐
- 【数据库备份】通过定时任务完成MySQL数据库的备份
- ORB_ Slam2 operation
- Raspberry pie assert preliminary exercise
- Pat class B 1013 C language
- PAT 乙等 1026 程序运行时间
- jvm-02.有序性保证
- How to specify the output path of pig register Project Log
- PAT 乙等 1014 C语言
- Real MySQL interview question (30) -- shell real estate order analysis
- Basic calculator for leetcode topic analysis
猜你喜欢

Adnroid activity screenshot save display to album view display picture animation disappear

数字藏品到底有什么魔力?目前有哪些靠谱的团队在开发

Real MySQL interview questions (XXVII) -- Classification of users by RFM analysis method

Wireshark TS | 视频 APP 无法播放问题

jvm-04.对象的内存布局

The digital collection market has just begun

云原生数据库是未来

Redis cache penetration solution - bloom filter

MySQL面试真题(二十四)——行列互换

jvm-05.垃圾回收
随机推荐
MySQL面试真题(二十二)——表连接后的条件筛选及分组筛选
How does win11 enable mobile hotspot? How to enable mobile hotspot in win11
The construction of digital factory can be divided into three aspects
Wireshark TS | 视频 APP 无法播放问题
Data migration from dolphin scheduler 1.2.1 to dolphin scheduler 2.0.5 and data test records after migration
Pat class B 1012 C language
What does the English letter PC mean? What does the Internet PC mean
C primer plus學習筆記 —— 2、常量與格式化IO(輸入/輸出)
ORB_ Slam2 operation
Oracle exception
Skill self check | do you know these 6 skills if you want to be a test leader?
Wechat applet: Puzzle toolbox
jvm-04.对象的内存布局
Behind the hot digital collections, a strong technical team is needed to support the northern technical team
Real MySQL interview question (XXVIII) -- case - Analysis of indicators of communication operators
AHA C language Chapter 7 you can do more with it (talks 27-28)
MySQL面试真题(二十八)——案例-通讯运营商指标分析
How to move the software downloaded from win11 app store to the desktop
Wechat applet: future wife query generator
数字藏品——新的投资机遇