ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iamleppert <>
Subject Ant Difference of Two Relative Paths?
Date Mon, 05 Jan 2009 17:45:59 GMT

Is it possible somehow using the pathconvert task to translate one relative
path to another, given a "reference point"?


Given the following directory structure:


I have relative paths in something.css like the following:

background-image: url(../images/image.gif);

I am copying and concating the CSS with another CSS, located in:


The base dir for the entire project is the root which contains both apps and
modules. (/ in this case)

I want to replace the ../images/image.gif in something.css with another
relative path, relative to apps/myapp/resources/css (the somethingelse.css
file), e.g:


If possible, it should have support for nested directories within
resources/css, so that resources/css/dir1/dir2/something.css will have its
paths translated correctly with the appropriate number of ../ prefixes.

That way, the image will be able to be found when both CSS are concated
together in its new location in 
apps/myapp/resources/css/, and I won't have to resort to using absolute
paths. Is this at all possible using pathconvert and a map or sorts? Or
would I be better of creating my own custom task?

Any pointers appreciated.


View this message in context:
Sent from the Ant - Users mailing list archive at

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

View raw message