ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Kneubuhl" <>
Subject RE: <replace> in .properties with Windows paths? (/ vs \\)
Date Tue, 30 Apr 2002 19:05:01 GMT

How can I use <pathconvert> to _change_ the value of ant properties? 
If I understand correctly, <pathconvert> only works with <path> types, but not
for <property> types.

	path foo = pathconvert(${})  

is ok, 

	property p = pathconvert(${}) 

is not.

I.e.. the property should be defined by the converted path:

	<property name="" refid="converted.path"/>

where converted.path was munged by the <pathconvert>.

This is something I was considering making a custom "prepare" task, to nab all the properties
from the Project, String.replace('\', '/'), and then reset the property in the Project.

This also solves the order of evaluation "bootstrap" problem.  Ant properties are immutable,
so they would all have to be defined after the <pathconvert> ran from within a task.
 However, properties are part of the "global" scope of the ant build.xml...


-----Original Message-----
From: Diane Holt []
Sent: Tuesday, April 30, 2002 11:45 AM
To: Ant Users List
Subject: Re: <replace> in .properties with Windows paths? (/ vs \\)

--- Joshua Kneubuhl <> wrote:
> I saw the <pathconvert> task, but it was not clear to me that one could
> pathconvert ant properties (even though a property specifies a path).

To use <pathconvert>, you'd need to set a <path> (or some other datatype
it understands), but you can reference your property(s) in the elements.
Just avoid the whole backslash mess and set all your values using
foreslashes (even for DOS paths), then, when you reference the properties
in attributes/elements that do the right thing, you shouldn't even have to
worry about converting anything (you'd need to <pathconvert> to get path
styles for an OS type you're not currently running under, but that should
be completely doable).



Do You Yahoo!?
Yahoo! Health - your guide to health and wellness

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message