English 中文(简体)
我可否利用安特来记录释放的历史?
原标题:can I use Ant to record the release history?

现在,我有一份<播音>文件文档和ant可在我发布时自动更新其内容(java申请)。 该版本文件的内容是:

buildDate=01-03-2012 165937
buildNum=1
buildMinor=0
buildMajor=0

现在,我想把释放历史保留在档案中(可能的话说,history.properties),因为我想知道什么时候释放了。

为了做到这一点,我必须自动做到如下:

  1. read the existing information from the version.properties file and joint them into one string, for example a string like this: 0.0.1 01-03-2012 165937 ;
  2. insert or append the new string into the history.properties file;

谁能告诉我,谁能做不到1和2的ant? 如果是,如何?

或者与我分享你更好的解决办法。

感谢

最佳回答

Use this target to store versions log in the end of each build:

<target name="save_version_history">
  <property file="version.properties" />
  <echo file="history.log" append="true" >${buildMajor}.${buildMinor}.${buildNum} ${buildDate}
</echo>
</target>

问题回答

我现在找到了解决办法。 我改变了历史的形式。 不动产

version=date

例如:

0.0.1=01-03-2012 165937

然后,我利用以下目标:

<target name="history" depends="init" >
        <loadproperties srcFile="${version.file}"/>
        <propertyfile
            file="${history.file}" comment="Build history info">
            <entry key="${buildMajor}.${buildMinor}.${buildNum}" type="string" value="${buildDate}"/>
        </propertyfile>
    </target>

由于切入钥匙是不同的,因此ant <>/strong>将append 至历史结束。 财产档案。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...