我用我的構建腳本如下所示的propertyfile任務:從Apache的螞蟻PropertyFile刪除日期評論任務
<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變量不發生變化,導致了沒有必要提交到版本控制由以下的diff只:
--- 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文件?我在propertyfile嵌套的entry元素中考慮了一個刪除操作,但是需要一個鍵值。
優秀的解決方法! – javacavaj 2010-08-13 18:19:50
通過省略byline =「true」保留其他評論 – Tarnschaf 2012-06-21 08:03:07
這是真的。好點子。 – JasonMArcher 2012-06-25 21:03:52