2013-11-14 76 views
0

我希望我的安裝程序文件的版本號是installer-02螞蟻版本與領先的零

我在<entry key="build.number" type="int" value="2" />

如何實現這一目標的以下條目。

回答

2

當您將entry添加到屬性文件http://ant.apache.org/manual/Tasks/propertyfile.html時,您可以指定pattern作爲int類型。

<propertyfile 
    file="my.properties" 
    comment="My properties"> 
    <entry key="build.number" type="int" value="2" pattern="00"/> 
</propertyfile> 

<property file="my.properties"/> 

<echo message="build.number : ${build.number}"/> 

請注意,如上所示,例如,它將使用0代表0到9之間的值。