What Ant property contains CWD when running an Ant script?

I don't want to get baseir, which seems to contain a build.xml script - I want the CWD call to be ant itself.

Basically, I want to do this:

$ cd /home/chrisr/projects/some_project
$ ant -f ../../tools/ant-build-rules/library.xml build-library

At this moment I need two things:

  • The path to ant -build rules in absolute form; it is currently in the property basedir, so I installed there.
  • The path some_project in absolute form. This is what I do not know how to do it.

What property contains this information?

+3
source share
2 answers

Java user.dir property contains current directory

<project name="demo" default="printCWD">
    <target name="printCWD">
        <echo message="${user.dir}"/>
    </target>
</project>
+8
source

There is no such property, but you can run the script to get it.

${bsh:WorkDirPath.getPath()}

. urbancode.com.

0

Source: https://habr.com/ru/post/1748365/


All Articles