Ant中的<tstamp />标签添加时间戳
在ANT的配置文件build.xml中可以使用<tstamp />标签添加时间戳标志。
<target name="dist" depends="compile" description="generate the distribution"> <tstamp prefix="buildtime" > <format property="TimeSign" pattern="yyyyMMddHHmmss" /> </tstamp> <mkdir dir="${dist.lib}" /> <jar jarfile="${dist.lib}/FirstTry-${buildtime.TimeSign}.jar" basedir="${build.classes}" /> </target>
如上所示,运行ant dist之后生成的jar文件名为FirstTry-20101215000156.jar之类,通过pattern调整时间戳格式。
相关推荐
BitsPlayer 2020-05-29
roygbip 2020-02-16
BitsPlayer 2020-02-13
lrcoop 2020-02-03
chichichi0 2020-01-06
BitsPlayer 2019-12-19
BitsPlayer 2019-12-14
xueliangEmail 2013-07-22
cailianren 2010-04-15
wugang0 2019-11-09
lustdevil 2011-08-28
evilvoid 2008-04-17
leonranri 2019-11-05
leeccr 2019-10-31
evilvoid 2010-02-02