This is Part 2 of a short series about optimising your build speeds. If you haven’t already, please check out Part 1, which describes the different build caches you can use.
In this post, I’ll explain some other build properties you can tweak. Let’s start with the Gradle ones.
One of my last tasks @ASOS was to investigate the slow build speeds of the Android application. This post is part of a short series about how we approached the problem, what we tried and what we found out. To be clear, don’t expect miracles and 🦄 here, but you’ll get a better understanding of what you can do to optimise your builds.
Here’s a few handy commands if you want to run only a specific unit test(s). Suppose we have the following unit tests in the project:
./gradlew test – run unit tests for all variants
./gradlew testDebug – run tests for Debug variant
./gradlew testDebug --tests="*.helpers.*" – run all tests in the
./gradlew testDebug --tests="*.HelperTest" – run all tests in
./gradlew testDebug --tests="*.getHelp" – run only the
getHelp test method.