Book Image

Mastering Gradle

Book Image

Mastering Gradle

Overview of this book

Table of Contents (17 chapters)
Mastering Gradle
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Migration from Ant


Ant is one of the initial build tools that became very popular among developers because they can control each and every step of the build process. But writing each and every step means a lot of boilerplate code in the build file. Another feature which was lacking in the initial Ant releases was complexity in dependency management, which was later simplified by introducing an Ivy dependency manager. For Ant users, it is very simple and easy to switch to using Gradle as their build tool. Gradle provides direct integration with Ant using Groovy's AntBuilder. Ant tasks are treated as first class citizens in the Gradle world. In the next sections, we will discuss three different strategies: importing Ant file into Gradle, script use of AntBuilder class and rewriting to Gradle. These strategies can be followed to migrate from Ant to Gradle.

Importing Ant file

This is one of the simplest ways of integrating the Ant script with Gradle script. It is very useful as the first step...