开发者

Ant: Want to have a property that has a timestamp in it

开发者 https://www.devze.com 2023-04-06 00:32 出处:网络
I\'m using Ant 1.8.2 on Ubuntu Linux (and also on Windows 7 running Cygwin).I have this property ... <property name=\"results\" location=\"${selenium.results.dir}/Results-20110922_131005.html\" /&

I'm using Ant 1.8.2 on Ubuntu Linux (and also on Windows 7 running Cygwin). I have this property ...

    <property name="results" location="${selenium.results.dir}/Results-20110922_131005.html" />

I would like to replace t开发者_StackOverflow社区he "20110922_131005" with something less hard coded that represents the current time stamp. How can I do this?


<tstamp>
     <format property="time.stamp" pattern="yyyy-MM-dd_HH:mm:ss"/>
</tstamp>

This will create a property called ${time.stamp}.

<property name="results" 
    location="${selenium.results.dir}/Results-${time.stamp}.html" />


you can use tstamp in ant. Also look at SO Question : output timestamp in ant

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号