how to get invoked ant.exe path in the ant script

170 Views Asked by At

Is there any way to get invoked ant.exe path in the ant script ? rather than the ant path set in environment variables. Using the env.ANT_HOME, one would get ant path in environmental variables, but that will not help me.

If ant script is invoked from "C:\Ant\bin\ant.exe", is there any way to get same path in ant script?

1

There are 1 best solutions below

3
saurabh14292 On

If ant script is invoked from "C:\Ant\bin\ant.exe", is there any way to get same path in ant script?

Yes. Assuming you are executing from above mentioned path, use "basedir" variable set to current working directory ie. where your script resides.

Something like this :

<project name="abc" default="test" basedir="." >