当前位置:网站首页>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面试真题(二十一)——金融-贷款逾期
- Wireshark TS | 视频 APP 无法播放问题
- Jvm: when a method is overloaded, the specific method to call is determined by the static type of the incoming parameter rather than the actual type of the parameter
- Addressing and addressing units
- True MySQL interview question (24) -- row column exchange
- Explanation of penetration test process and methodology (Introduction to web security 04)
- The author believes that the so-called industrial Internet is a process of deep integration of industry and the Internet
- jvm-05.垃圾回收
- The digital collection market has just begun
- Real MySQL interview questions (25) -- common group comparison scenarios
猜你喜欢

Wechat applet: wechat can also send flash photos to create wechat applet source code download and customize flash time

The performance of nonstandard sprintf code in different platforms

Visdom draws multiple dynamic loss curves

C primer plus learning notes - 2. Constant and formatted IO (input / output)

True MySQL interview question (24) -- row column exchange
![[image fusion] sparse regularization based on non convex penalty to realize image fusion with matlab code](/img/e2/24eb2a60e3dc603b3ec4bfefd0b8e5.png)
[image fusion] sparse regularization based on non convex penalty to realize image fusion with matlab code

Wechat applet: Puzzle toolbox

云原生数据库是未来

技能自检 | 想当测试Leader,这6项技能你会吗?

C prime plus notes d'apprentissage - 2, constantes et formatage io (I / o)
随机推荐
编址和编址单位
云原生数据库是未来
PAT 乙等 1014 C语言
Centos7 installation of postgresql8.2.15 and creation of stored procedures
工作积累-判断GPS是否打开
Wechat applet: elderly blessing short video
Wechat applet: wechat can also send flash photos to create wechat applet source code download and customize flash time
The difference between SaaS software and traditional software delivery mode
jvm-03.jvm内存模型
PAT 乙等 1013 C语言
vant weapp日历组件性能优化 Calendar 日历添加min-date最小日期页面加载缓慢
Jvm: when a method is overloaded, the specific method to call is determined by the static type of the incoming parameter rather than the actual type of the parameter
Basic calculator II for leetcode topic analysis
How to move the software downloaded from win11 app store to the desktop
Opencv display image
HierarchyViewer工具找不到 HierarchyViewer位置
MySQL面试真题(二十一)——金融-贷款逾期
Real MySQL interview question (23) -- pinduoduo ball game analysis
【owt】owt-client-native-p2p-e2e-test vs2017构建 6:修改脚本自动生成vs工程
The construction of digital factory can be divided into three aspects