Speeding up builds

A lot of Android developers that start using Gradle complain about the prolonged compilation time. Builds can take longer than they do with Ant, because Gradle has three phases in the build lifecycle that it goes through every time you execute a task. This makes the whole process very configurable, but also quite slow. Luckily, there are several ways to speed up Gradle builds.

Gradle properties

One way to tweak the speed of a Gradle build is to change some of the default settings. We already mentioned in parallel build execution in Chapter 5, Managing Multimodule Builds, but there are a few more settings that you can adjust.

Just to recap, you can enable parallel builds by setting a property in a gradle.properties file that is ...

Get Gradle for Android now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.