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

来源:互联网 发布:网络语乌干达什么意思 编辑:程序博客网 时间:2024/05/16 11:55

说明

用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

0 0
原创粉丝点击