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.

Logically:
        path foo = pathconvert(${some.property})  

is ok, 

but 
        property p = pathconvert(${some.property}) 

is not.

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

        <property name="converted.path.property" 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...


cheers,
-josh




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


--- Joshua Kneubuhl <[EMAIL PROTECTED]> 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).

Diane

=====
([EMAIL PROTECTED])



__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

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


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

Reply via email to