tags:

views:

264

answers:

1

Is it possible to tell which directory the user ran Ant from?

For example, I might want to run only the unit tests in the current working directory, rather than all tests for the entire project.

I tried this:

<property environment="env" />
<echo>${env.CWD}</echo>

but that doesn't work.

+3  A: 

The whole Properties object returned by System.getProperties() is exposed by Ant. Try this:

<echo>${user.dir}</echo>

Asaph
It was staring me in the face and I ignored it. Thanks!
JW