Hi I'm having an issue with writing out a property which holds the value of a directory path into a property file.
My script originally reads in this particular property, call it 'appserver.home', from a props file using the <property file="source.props"/>
. I've echoed the value coming in and it reads correctly as *C\:\\somedir\\jboss_4_2_3.*
What my script needs to do next is provide this value to another properties file (used by another ant script - though that's not important). To create this other file I'm using a kind off template file with place holders surrounded by $....$ to insert the correct values in the correct place, using the following :-
<copy file="template_file.props" tofile="target.props">
<filterset begintoken="$" endtoken="$">
<filter token="appServerDir" value="${appserver.home}"/>
<filter token="dbusername" value="${database.name}"/>
....
</filterset>
</copy>
The problem is that the value now in the target.props is *C:\somedir\jboss_4_2_3* ie it's lost the escape characters. When the next ant script uses this file it interprets the property value as *C:somedirjboss_4_2_3*.
So the question how do I tell ant that the value I'm writing is a file path ? Note I have tried the following, which actually works :-
<propertyfile file="target.props">
<entry key="appServerDir" value="${appserver.home}"/>
</propertyfile>
.. ie it outputs the name as *c\:\\somedir\\jboss4_2_3*, but I'd rather not use this technique and rather use the template file technique, as it contains some properties which are always static, as well as comments etc.
Thanks in advance