ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Kneubuhl" <joshua.kneub...@demandtec.com>
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.

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:holtdl@yahoo.com]
Sent: Tuesday, April 30, 2002 11:45 AM
To: Ant Users List
Subject: Re: <replace> in .properties with Windows paths? (/ vs \\)


--- Joshua Kneubuhl <joshua.kneubuhl@demandtec.com> 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

=====
(holtdl@yahoo.com)



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

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message