I have a value in a properties file that I want to increment while the build is running. The goal is to copy a set of files and append a number to the front of each in order to maintain the order in which they were copied into the directory. I am using the <propertyfile>
task as follows:
<propertyfile file="jsfiles.properties">
<entry key="file.number" type="int" operation="=" value="10" />
<entry key="file.number" type="int" default="010" operation="+" value="10" pattern="000" />
</propertyfile>
Then I do the copy:
<copy todir="${js-in.dir}">
<resources>
...
</resources>
<chainedmapper>
<flattenmapper />
<globmapper from="*.js" to="${file.number}-*.js"/>
</chainedmapper>
</copy>
This does exactly what I need it to EXCEPT that instead of the following output:
- 010-file1.js
- 020-file2.js
- 030-file3.js
- ...
I get:
- ${file.number}-file1.js
- ${file.number}-file2.js
- ${file.number}-file3.js
- ...
What am I doing wrong?
Update: Per one of the answers below, a simpler case:
<propertyfile file="jsfiles.properties">
<entry key="file.number" type="int" operation="=" value="10" />
<entry key="file.number" type="int" default="0010" operation="+" value="10" pattern="0000" />
</propertyfile>
<target name="concat">
<echo>${file.number}</echo>
</target>
Prints [echo] ${file.number}