My command line app call looks like this:
java -jar myapp.jar --output c:\test.txt c:\test.txt
Which reads test.txt, processes it and saves result to the same file.
I am trying to make ant task out of it but can't figure out how to make it use same path for input and output.
<target name="compress">
<apply executable="java" parallel="false">
<fileset dir="c:/test/" includes="*.txt">
</fileset>
<arg line="-jar"/>
<arg path="myapp.jar"/>
<srcfile/>
<arg line="--output"/>
<mapper type="glob" from="*" to="c:/test/*"/>
<targetfile/>
</apply>
</target>
Which doesn't work. Using <mapper type="identity"/>
and setting dest="c:/test/"
for apply task doesn't work either. Looks like it just doesn't want to rewrite existing files. Is there a way to make it work without writing output to a separated folder, then deleting all files from the original folder and copying files back to original folder?
Thanks.