When echoing to a file. echo is printing extra tabs before what is printed.
I do not want these tabs there, why is ant doing this and how do i prevent?
Only using ant and/or ant-contrib. Nothing else.
<target
name="doThis">
<delete
file="${PATH}/install.bat"
failonerror="true">
</delete>
<touch file="${PATH}/install.bat"></touch>
<echo
file="${PATH}/install.bat"
level="verbose"
append="true"
message="if exist preinstall.bat call preinstall.bat${line.separator}">
</echo>
<foreach
trim="true"
target="printStuff"
param="stuffName">
<path>
<fileset dir="${basedir}/stuff/"></fileset>
</path>
</foreach>
</target>
<target
name="printStuff">
<basename file="${stuffName}" property="stuffNameSmall"/>
<echo
file="${PATH}/install.bat"
append="true"
level="verbose"
message="${stuffNameSmall}${line.separator}">
</echo>
</target>
Example of output that is being printed currently:
<tab><tab>filename
<tab><tab>filename
<tab><tab>filename
My hunch: you have 2 tab chars inside the <echo …> </echo> xml element…
Try:
The ‘echo’ task will print out the ‘message’ attribute value, as well as everything inside the nested text node. So best to always close the tag immediately if you don’t need to printout extra stuff (like multi-line ASCII art, oh yeah!).