Ant.home not set from Gradle


(Povl Kvols) #1

(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?


(Benjamin Muschko) #2

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


(Povl Kvols) #3

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.


(Benjamin Muschko) #4

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’?


(Povl Kvols) #5

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