How to change ant version?


(Harald Hartmann) #1

Hi,

i’m using gradle 1.6 wrapper. I’m successfully building a 3rd software project with it. But now, the 3rd software project have to use ant-1.9.1. Facing up http://forums.gradle.org/gradle/topics/gradle_1_7_any_plans_to_upgrade_ant_and_ivy i hope it’s just a joke that there’s no easy way to change ant version within gradle?

I could change the gradle-core-classpath.properties and import ant-1.9.1 in lib, but this results in problems with the original concept of wrapper.

I could change all ant calls in my build.gradle with sshexec blablabla, it’s a joke too

So how to change the ant version the easy way?

Regards Harald Hartmann


(Peter Niederwieser) #2

The main use of Ant in Gradle is to invoke some Ant task for which no Gradle equivalent exists. For that purpose, the Ant version that Gradle ships with (usually the latest version) works just fine. Since Gradle’s Ant support integrates deeply with Ant APIs, it can’t be switched to a different Ant version. If you do need to use a different Ant version, you can either call out to Ant, or write a plugin that makes programmatic use of Ant. For the latter, your plugin might have to create its own child-first (Ant) class loader.


(Harald Hartmann) #3

Hi Peter,

thanks for your answer.

In the meantime i replaced ant(-)-1.8.4 with ant(-)-1.9.1 in lib and lib/plugins, changed the properties in several gradle--1.6.jar(s). At the moment it works fine for me and i hope i won’t have any sideaffects cause ant(-)-1.8.4 is so deeply integrated.

“own child-first (Ant) class loader”? sounds more complicated to me.

“call out to Ant” yes in deed, i will do so in future, replace all ant.* to something like execute(ant…)

Regards Harald Hartmann


(Peter Niederwieser) #4

Upcoming Gradle 1.8 ships with Ant 1.9.2. Which is it so important to you to be in control of the Ant version?


(Harald Hartmann) #5

Cause i’m using gradle as a wrapper around the ant of the 3rd software project, which one can change its ant version every time and checks if you have the right ant version calling the build.xml The last version of the 3rd software project matches the ant version from gradle-1.6 … by fluke as i now carried out :smiley:


(Denis Lutz) #6

Hey Guys,

I am having the same issue. I have third party software that enforces Ant 1.9.1 only. Nothing else, so I cant use gradle wraper easily now. Is there way to solve this?

Thank you so much,

BTW: I love gradle after using it for just couple days, awesome job!