You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Christopher Styles <st...@gmail.com> on 2007/11/06 14:49:45 UTC

Propertyfile Task not updating build numbers

Hi,

I created the two targets below to update my build and last build numbers in
my build.properties before my build actually starts, but for some reason
they're not updating the numbers.... The propertyfile file attribute
specifies the name of the property file and each nested entry element
specifies how the value of a property file key should be modified. In this
case, the value of the keys "build.internal.number" and "last.number" are
treated as an int and the value 1 is added upon each invocation.... These
two targets are in my build.xml, of course, and they seem to be executing,
but the numbers aren't getting updated in my build.properties file... Am I
doing something wrong...??? If so, can someone please point me in the right
direction...??? Do I need to add the optional.jar to my ant lib folder...???


<target name="update-intbldnum">
    <propertyfile file="build.properties">
        <entry key="build.internal.number" type="int" operation="+"
value="1"/>
    </propertyfile>
</target>

  <target name="update-lastlbl">
        <propertyfile file="build.properties">
            <entry key="last.number" type="int" operation="+" value="1"/>
        </propertyfile>
</target>

Thanks

Re: Propertyfile Task not updating build numbers

Posted by David Weintraub <qa...@gmail.com>.
Why not use the <BuildNumber> task? It'll do exactly what you want.

BTW, once you define a property, you cannot change its value. I think
this might be your problem.

On 11/6/07, Christopher Styles <st...@gmail.com> wrote:
> Hi,
>
> I created the two targets below to update my build and last build numbers in
> my build.properties before my build actually starts, but for some reason
> they're not updating the numbers.... The propertyfile file attribute
> specifies the name of the property file and each nested entry element
> specifies how the value of a property file key should be modified. In this
> case, the value of the keys "build.internal.number" and "last.number" are
> treated as an int and the value 1 is added upon each invocation.... These
> two targets are in my build.xml, of course, and they seem to be executing,
> but the numbers aren't getting updated in my build.properties file... Am I
> doing something wrong...??? If so, can someone please point me in the right
> direction...??? Do I need to add the optional.jar to my ant lib folder...???
>
>
> <target name="update-intbldnum">
>     <propertyfile file="build.properties">
>         <entry key="build.internal.number" type="int" operation="+"
> value="1"/>
>     </propertyfile>
> </target>
>
>   <target name="update-lastlbl">
>         <propertyfile file="build.properties">
>             <entry key="last.number" type="int" operation="+" value="1"/>
>         </propertyfile>
> </target>
>
> Thanks
>


-- 
--
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org