Using Ant from Gradle
If you have invested a lot of time in setting up a build with Ant, the switch to Gradle might sound scary. In that case, Gradle cannot only execute Ant tasks, it can also expand them. This means you can migrate from Ant to Gradle in smaller steps, instead of spending several days on converting your entire build configuration.
Gradle uses Groovy's AntBuilder for the Ant integration. The AntBuilder enables you to execute any standard Ant task, your own custom Ant tasks, and entire Ant builds. It also makes it possible to define Ant properties in your Gradle build configuration.
Running Ant tasks from Gradle
Running a standard Ant task from Gradle is straightforward. You just need to prepend the task name with ant.
and everything works out of the box. For example, to create an archive, you can use this task:
task archive << { ant.echo 'Ant is archiving...' ant.zip(destfile: 'archive.zip') { fileset(dir: 'zipme') } }
The task is defined in Gradle, but...