Running Gradle Builds in RAM

January 3, 2016 JVM

If you have lots of RAM and a slow HDD, this piece of advice will show you how to make builds finish much faster.

Set buildDir property to a directory mounted to RAM, such as /tmp. There are several ways of doing this:

a) In project-level build.gradle

allprojects {
    buildDir='/tmp/${rootProject.name}/${project.name}'
}

b) In gradle.properties

buildDir='/tmp/gradle-build-dir'

c) Via command-line arguments

-Dorg.gradle.project.buildDir=/tmp/gradle-build-dir

References

comments powered by Disqus