Ant.home not set from Gradle

(NOTE: This was originally posted as a question, but I think that it could actually be an error)

I’ve had some problems running ant scripts from Gradle, using ant.importbuild

It appears that ant.home was not set, despite the environment variable ANT_HOME was set correctly.

This line in Gradle did of course solve it:

ant.'ant.home'= System.env.'ANT_HOME'

…but shouldn’t ant.home be set already?

Please see the answer to a similar question. ‘ant.home’ is not available as Gradle only ships the libraries.

My problem is not as much how to get around the problem, but rather if this shouldn’t be fixed in Gradle? The variable ant.home is part of Ant, and it is expected to be set in many Ant scripts.

Gradle does not include a full distribution of Ant, only the libraries. What’s your specific use case that requires you to have ‘ant.home’?

I am translating some legacy Ant stuff to Gradle in a rather large custom set-up. Some scripts will be re-done in Gradle, other scripts will stay in Ant for now, because parts of the project build needs to be re-engineered.

Some of the Ant scripts refers to ant.home, e.g. to include ant-contrib.

I was just a bit surprised that Gradle doesn’t include ant.home since it appears to be a vary basic thing to do, in order to make old Ant scripts work a little easier. Maybe I don’t see the whole picture, but this appears to be both an important part of ant, and a very easy thing to do in Gradle.

No big deal - I found a work-around in a few minutes after finding out what caused the problem, so at least I don’t have this problem anymore… :wink:

In this specific instance, I wanted to