You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/07/11 14:57:05 UTC

DO NOT REPLY [Bug 21505] New: - propertyfile does *2 instead of +1

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21505>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21505

propertyfile does *2 instead of +1

           Summary: propertyfile does *2 instead of +1
           Product: Ant
           Version: 1.5.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: ts@appliedgenerics.com


The propertyfile task gets confused if multiple targets are specified to Ant.

Here is an example:

   <target name="bugDemo1" depends="bugDemoInit">
      <echo>property is ${foo}</echo>
   </target>

   <target name="bugDemo2" depends="bugDemoInit">
      <echo>property is ${foo}</echo>
      <concat>
        <fileset file="bugPropFile"/>
      </concat>
   </target>

   <target name="bugDemoInit">
      <echo>property is ${foo}</echo>
      <propertyfile file="bugPropFile">
         <entry key="foo" default="0" value="1" operation="+" type="int"/>
      </propertyfile>
      <property file="bugPropFile"/>
      <echo>property is ${foo}</echo>
   </target>

Running Ant with arguments "bugDemo1 bugDemo2" causes the init target to be run
twice. The first time it increments the number in the file, but the second time
it doubles it.

If the init target is run three times then the number is incremented the first
time then doubled twice.

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