How to specify base dir then we run ant like ant -f somedir/dir/build.xml.
Ant sets basedir relative to build.xml, if I specify
You can try to use subant task:
Assuming you have two different folders
Your current folder X:/your/launching/folder where you are executing ant command from
Folder where your destination bulid.xml is: Y:/any/folder/with/build.xml
You can do the following:
Create build.xml in X:/your/launching/folder with the next content:
Then you can execute ant mytarget from X:/your/launching/folder folder to start building your Y:/any/folder/with/build.xml
Update:
You can override basedir property for subant build like this: