您的位置:首页 > Web前端

用Ant生成Jar文件时在manifest中加入定制格式的打包时间

2014-02-08 15:10 393 查看

说明

用tstamp和manifest可以实现这个功能。
<?xml version="1.0" encoding="UTF-8"?>

<project name="AntTest" default="build" basedir=".">
<target name="build">

<!-- create timestamp with tstamp -->
<tstamp>
<format property="touch.time" pattern="yyyy/MM/dd hh:mm" />
</tstamp>
<echo message="${touch.time}" />

<jar destfile="test.jar" basedir="./target">
<include name="**/*.*" />

<!-- set mainfest information to manifest -->
<manifest>
<attribute name="Implementation-Maker" value="tian.yu" />
<attribute name="Implementation-Time" value="${touch.time}" />
</manifest>
</jar>
</target>
</project>


原文链接地址:http://dncsoft.iteye.com/blog/324672
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: