October 2, 2015

Gradle Goodness: Setting Global Properties For All Gradle Builds

To define project properties outside the Gradle build file, we can define them in a file gradle.properties in our project directory. If we want to define property values that are used by all Gradle builds we can create a file gradle.properties in the GRADLE_USER_HOME directory. By default this is in the USER_HOME/.gradle directory.

In the following example gradle.properties file we assign values to some properties that can be used in all Gradle builds we run on our computer. We store the file in USER_HOME/.gradle.

# Bintray username and password.

# Enable Gradle daemon for all builds.

Written with Gradle 2.7.