ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brent Bain <Brent.B...@marketlive.com>
Subject How To Parse ${basedir} ??
Date Tue, 15 Mar 2005 18:54:37 GMT
Hello:

I am attempting to remove references to hard coded drive letters as some of
our machines build from different drives or on linux environments.
Our current path structure looks like:
C:\repo\project\source\ant\
C:\repo\libraries\
 
Since the ant references files in the libraries folder we currently just
have a property set to the base of repo (repo.base=C:\repo).  My temporary
work around was to simply add another property that said what drive we were
on:
repo.drive=C
repo.base=${repo.drive}\repo
repo.libraries.base=${repo.base}\libraries
 
Now I'm trying to remove references to repo.drive.  The only assumption I'd
like to make is that libraries will always be in the same spot.  The ant
folder could change directory levels (down or up) so I'd like to
programtically figure out the current path and then know how to get to the
libraries folder.
 
I figured I could use ../ to move my way up and down the folder structure
but that will only continue to work if the ant folder stays at the same
level:
repo.base=${basedir}../../../
 
Am I missing something obvious that will let me parse the basedir property
if I always know that I'm looking for a specific word (repo) and return
everything before that?  Something that would look at my basedir:
C:\repo\projects\source\ant
and return:
C:\repo
 
Any help would be greatly appreciated!!
Thanks,
Brent
 
 
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message