aspose file tools
The moose likes Ant, Maven and Other Build Tools and the fly likes noob to ant need help please Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "noob to ant need help please" Watch "noob to ant need help please" New topic
Author

noob to ant need help please

Tai Lo
Greenhorn

Joined: Aug 30, 2010
Posts: 2
if i want to step out of the base directory in XML, how would I do that.
ie. ( basedir = /users/local/src/tests/files but I want /users/local/src/tests/)

I've tried <sysproperty key="thisVal" value="${basedir}/../"/> but that seems to fail. Any ideas would be great. thanks.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3206

Hi Tai and welcome to Javaranch!

Have you tried ../../{${basedir}


Cheers, Martijn - Blog, Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!
Tai Lo
Greenhorn

Joined: Aug 30, 2010
Posts: 2
thanks martijn. This is what i get with your recommendation


<property name = "test" value="../../{${basedir}"/>
<echo message = "this is test #${mb.test}"/>

:this is test #../../{/Users/taiLo/cvs/check

In this case I want /Users/TaiLo/cvs ~ does echoing the variable return the actual value of that variable?

Thanks for your help
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3206

Oh sorry! Completely mis-read your original question, let me look up some ANT docs and see if I can find something for you.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 4489

basedir = /users/local/src/tests/files but I want /users/local/src/tests/

Assuming that build.xml is in /users/local/src/tests/files, you should be able to do:

<property name = "tests.dir" value=".." />


JBoss In Action
 
 
subject: noob to ant need help please
 
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture