You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Chris Brown <br...@reflexe.fr> on 2002/09/02 10:08:04 UTC

[Ant 1.4.1] Optional task and "+" operation

Hello,

Sometimes when I use the <propertyfile> task, with the increment operation,
instead of adding 1 to the value of the property entry, it multiplies it by
two...  I can execute exactly the same task once, and it adds "1", other
times, with no change in any parameter or the environment, it multiplies it
by two.  I'm only executing the task once each time I run the buildfile, so
I don't think it's an issue relating to immutable property values.  Here's
an example of my task anyway:

<propertyfile file="${buildnumber-file-path}">
  <entry key="build-number" type="int" operation="+"
    value="1" default="0"/>
</propertyfile>

I've also noticed that when the value of the build-number variable exceeds
1000 in a French locale, an non-breakable space character is added to the
number, to make it "1 000".  Unfortunately, this means that in subsequent
builds, the number becomes "1\u00A0000" (or similar), and is thereafter
useless.  Could be an implementation issue concerning the use of
NumberFormat..?

By the way, I've still not upgraded to Ant 1.5.x because I've heard that
there's a bug when updating zip/jar files... so I can't yet take advantage
of the buildnumber task.

- Chris



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Ant 1.4.1] Optional task and "+" operation

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
<propertyfile> had a lot of issues prior to 1.5, or at least it was very 
tough to make sense of the code and it did funky things.  I gutted and 
refactored <propertyfile> a lot for the 1.5 codebase and added several 
test cases to ensure that it is operating as expected.

Multiplying by 2?  I'm certain there is no code in there to multiply, so 
that seems very odd.

Perhaps the locale problem would be fixed by using a pattern attribute 
on your <entry>?

I'd recommend bumping up to 1.5 and seeing if that solves your problems 
- and if you do happen to experience a bug with the zip feature report 
it back to ant-dev.  It can't hurt to run a few builds with a new 
version of Ant, can it?!  :)

	Erik


Chris Brown wrote:
> Hello,
> 
> Sometimes when I use the <propertyfile> task, with the increment operation,
> instead of adding 1 to the value of the property entry, it multiplies it by
> two...  I can execute exactly the same task once, and it adds "1", other
> times, with no change in any parameter or the environment, it multiplies it
> by two.  I'm only executing the task once each time I run the buildfile, so
> I don't think it's an issue relating to immutable property values.  Here's
> an example of my task anyway:
> 
> <propertyfile file="${buildnumber-file-path}">
>   <entry key="build-number" type="int" operation="+"
>     value="1" default="0"/>
> </propertyfile>
> 
> I've also noticed that when the value of the build-number variable exceeds
> 1000 in a French locale, an non-breakable space character is added to the
> number, to make it "1 000".  Unfortunately, this means that in subsequent
> builds, the number becomes "1\u00A0000" (or similar), and is thereafter
> useless.  Could be an implementation issue concerning the use of
> NumberFormat..?
> 
> By the way, I've still not upgraded to Ant 1.5.x because I've heard that
> there's a bug when updating zip/jar files... so I can't yet take advantage
> of the buildnumber task.
> 
> - Chris
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>