在Ant属性中存储UNIX时间戳?
|
我想在Ant属性中存储UNIX时间戳(即自纪元以来的秒数),以便以后在几个构建目标中使用。似乎不可能:
<tstamp>
<format property=\"build.time\" />
</tstamp>`
...生成格式化的时间戳。
<propertyfile file=\"foo.properties\">
<entry key=\"build.time\" type=\"date\" default=\"now\" />
</propertyfile>
...还会生成格式化的时间戳记。
我希望不用<exec>
或类似的东西就可以做到这一点(因为有时我们会在Windows上运行该版本)。
没有找到相关结果
已邀请:
1 个回复
土投
可以使IMO更清洁的其他方法是 创建自己的自定义anttask。确实没有那么困难; http://ant.apache.org/manual/develop.html 使用Maven exec插件执行Java可以做到这一点: http://mojo.codehaus.org/exec-maven-plugin/