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

替换指定字符串
| < | < | 小于号 |
| > | > | 大于号 |
| & | & | 和 |
| ' | ' | 单引号 |
| " | " | 双引号 |
边栏推荐
- jvm-01.指令重排
- [proteus simulation] Arduino uno+pcf8574+lcd1602+mpx4250 electronic scale
- Centos7 installation of postgresql8.2.15 and creation of stored procedures
- True MySQL interview question (24) -- row column exchange
- Behind the hot digital collections, a strong technical team is needed to support the northern technical team
- The performance of nonstandard sprintf code in different platforms
- MySQL character set
- 数字藏品赋能实体产业释放了哪些利好?
- Real MySQL interview question (23) -- pinduoduo ball game analysis
- MDM data cleaning function development description
猜你喜欢

Wechat applet: unfashionable love talk

Three most advanced certifications, two innovative technologies and two outstanding cases, Alibaba cloud appeared at the cloud native industry conference

Wechat applet: Star Trek spaceship ticket production and generation

华为软硬件生态圈成型,从根子上改变美国对软硬件体系的领导地位

New classes are launched | 5 minutes each time, you can easily play with Alibaba cloud container service!

MySQL面试真题(二十九)——案例-找到爱看的电影

MySQL面试真题(二十七)——RFM分析法对用户进行分类

Real MySQL interview question (XXVIII) -- case - Analysis of indicators of communication operators

Visdom draws multiple dynamic loss curves

Adnroid activity screenshot save display to album view display picture animation disappear
随机推荐
android Handler内存泄露 kotlin内存泄露处理
【owt】owt-client-native-p2p-e2e-test vs2017构建 6:修改脚本自动生成vs工程
数字藏品市场才刚刚开始
TCP/IP 详解(第 2 版) 笔记 / 3 链路层 / 3.4 网桥与交换机
制造业数字化转型存在问题及原因分析
Digital collections - new investment opportunities
What is the magic of digital collections? Which reliable teams are currently developing
jvm-06.垃圾回收器
PAT 乙等 1021 个位数统计
Pat class B 1014 C language
三项最高级认证,两项创新技术、两大优秀案例,阿里云亮相云原生产业大会
Real MySQL interview question (23) -- pinduoduo ball game analysis
Genetic engineering of AI art? Use # artbreeder to change any shape of the image
HierarchyViewer工具找不到 HierarchyViewer位置
Addressing and addressing units
Software design and Development Notes 2: serial port debugging tool based on QT design
C prime plus notes d'apprentissage - 2, constantes et formatage io (I / o)
MDM data cleaning function development description
[OWT] OWT client native P2P E2E test vs2017 build 6: modify script automatic generation vs Project
Analysis on the problems and causes of digital transformation of manufacturing industry