I actually did find a solution in the following thread (but have yet to test
it):

http://mail-archives.apache.org/mod_mbox/ant-user/200811.mbox/%3c20411245.p...@talk.nabble.com%3e

My issue is I don't know the final base dir where this will all be
installed, so it needs to be portable with respect to how all the
directories are arranged, that is, it should be able to be copied to various
places or installed whereever, and then hosted via whatever document root
and just work.

Hopefully the above solution should work, and if it does I'll probably make
it a task.

Thanks,

Johnathan


supareno wrote:
> 
> iamleppert a écrit :
>> Is it possible somehow using the pathconvert task to translate one
>> relative
>> path to another, given a "reference point"?
>>
>> E.g.
>>
>> Given the following directory structure:
>>
>> modules/mymodule/resources/css/something.css
>>
>> 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:
>>
>> apps/myapp/resources/css/somethingelse.css
>>
>> 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:
>>
>> ../../../../modules/mymodule/resources/images/image.gif
>>
>> 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.
>>
>> Thanks!
>>
>> Johnathan
>>   
> Jonathan,
> 
> you could use the filter task 
> (http://ant.apache.org/manual/CoreTasks/filter.html) be i'm not sure 
> that it will be a suitable solution for your problem.
> 
> in my opinion, the best way is to concatenate and move the css file 
> created file to a new css folder created to receive these files (and the 
> images too),
> 
> first file:
> modules/mymodule/resources/css/something.css
> second file:
> apps/myapp/resources/css/somethingelse.css
> 
> created file: myconcatenatedfile.css
> 
> can you put the new file in the new project structure css folder? (see 
> below the structure)
> 
> <your_app>
>     ...
>     css/
>      - myconcatenatedfile.css
>     images/
>      - image.gif
>     ...
> 
> is it possible?
> 
> supareno
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Ant-Difference-of-Two-Relative-Paths--tp21295682p21325019.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to