【发布时间】:2011-03-27 23:57:10
【问题描述】:
我正在构建脚本中使用下面显示的属性文件任务:
<target name="build-brand" depends="-init" description="Adds version information to branding files.">
<propertyfile file="${basedir}/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties">
<entry key="currentVersion" value="${app.windowtitle} ${app.version}" />
</propertyfile>
</target>
任务按预期工作,除了每次构建项目时,Bundle.properties 文件的日期注释行都会更新为当前时间戳。即使 app.version 变量没有更改并导致对仅包含以下差异的版本控制的不必要提交也会发生这种情况:
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -1,4 +1,4 @@
-#Thu, 22 Jul 2010 15:05:24 -0400
+#Tue, 10 Aug 2010 13:38:27 -0400
如何防止在 .properties 文件中添加或删除此日期注释?我考虑过属性文件嵌套条目元素中的删除操作,但需要一个键值。
【问题讨论】: