Or using <pathconvert>?

Regards
Ivan

--- EJ Ciramella <[EMAIL PROTECTED]> wrote:

> what's using the property in the property file?  
> 
> why not have "/" instead of "\"?
> 
> If you MUST have "\", why not let your build finish,
> then have another replace step to change "\" to
> "\\"?
> 
> -----Original Message-----
> From: Michael Burbidge [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 06, 2006 2:11 PM
> To: user@ant.apache.org
> Subject: Generating property file with path name...
> 
> 
> As part of an ant build I need to generate a
> properties file with a path
> in it. I start with a "template" properties file
> with the following line
> in it:
> 
>  
> 
> Home = @HOME@
> 
>  
> 
> I then use the following ant tasks to replace the
> @HOME@ with a path
> generated as part of the ant build.
> 
>  
> 
>             <path id="home.path"
> path="${basedir}/../../../../../build/win/debug"/>
> 
>             <property name="home.system.path"
> refid="home.path"/>
> 
>             
> 
>             <target name="gen.config">
> 
>                         <copy
> file="${ids.config.template}"
> tofile="${ids.config}" overwrite="true">
> 
>                           <filterchain>
> 
>                             <replacetokens>
> 
>                               <token key="HOME"
> value="${home.system.path}"/>
> 
>                             </replacetokens>
> 
>                           </filterchain>
> 
>                         </copy>
> 
>             </target>
> 
>  
> 
> The resulting file contains the following line:
> 
>  
> 
> Home = c:\xenon\build\win\debug
> 
>  
> 
> I thought this was really cool till I realized that
> the '\' must be
> escaped in java property files. What I really want
> is:
> 
>  
> 
> Home = c:\\xenon\\build\\win\\debug
> 
>  
> 
> Can anyone suggest a better way to do this? Is there
> a way to get a
> system path to put in a properties file with the
> appropriate escaped
> charaters?
> 
>  
> 
> Thanks,
> 
> Michael-
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to