当前位置:网站首页>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}

替换指定字符串
| < | < | 小于号 |
| > | > | 大于号 |
| & | & | 和 |
| ' | ' | 单引号 |
| " | " | 双引号 |
边栏推荐
- C primer plus学习笔记 —— 2、常量与格式化IO(输入/输出)
- 【斯坦福计网CS144项目】Lab2: TCPReceiver
- jvm-06.垃圾回收器
- jvm-02.有序性保证
- PAT 乙等 1015 C语言
- PAT 乙等 1016 C语言
- 【数据库备份】通过定时任务完成MySQL数据库的备份
- 线性表 链表结构的实现
- Three most advanced certifications, two innovative technologies and two outstanding cases, Alibaba cloud appeared at the cloud native industry conference
- PAT 乙等 1014 C语言
猜你喜欢

数字化工厂建设可划分为三个方面

Behind the hot digital collections, a strong technical team is needed to support the northern technical team

Heimdall database proxy scale out 20 times

Wechat applet: a new interesting test

Real MySQL interview questions (XXVI) -- didi 2020 written examination questions

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

Deploy docker and install MySQL in centos7

数字藏品——新的投资机遇

The construction of digital factory can be divided into three aspects

编址和编址单位
随机推荐
Wechat applet; AI intelligent dubbing assistant
Use of visdom
[OWT] OWT client native P2P E2E test vs2017 build 6: modify script automatic generation vs Project
MySQL面试真题(二十七)——RFM分析法对用户进行分类
Pat class B 1013 C language
iNFTnews | 加密之家从宇宙寄来的明信片,你会收到哪一张?
What benefits have digital collections enabled the real industry to release?
数字藏品到底有什么魔力?目前有哪些靠谱的团队在开发
PAT 乙等 1023 组个最小数
Alibaba cloud ack one and ACK cloud native AI suite have been newly released to meet the needs of the end of the computing era
Deploy docker and install MySQL in centos7
阿里云 ACK One、ACK 云原生 AI 套件新发布,解决算力时代下场景化需求
TCP/IP 详解(第 2 版) 笔记 / 3 链路层 / 3.4 网桥与交换机
PAT 乙等 1014 C语言
How can digital collections empower economic entities?
Wechat applet: elderly blessing short video
jvm-04.对象的内存布局
数字藏品市场才刚刚开始
工作积累-判断GPS是否打开
Software design and Development Notes 2: serial port debugging tool based on QT design