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
ant -f somedir/dir/build.xml.
another solution (if it makes more sense in some cases) could be to override basedir via the var task from the antcontrib extension as described here: https://stackoverflow.com/a/25786329/1915920
basedir
var
antcontrib