O'Reilly logo

Gradle for Android by Kevin Pelgrims

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required