How to configure Android project's build types in Gradle? Table of Contents Generate Java Constants Generate Android resources A few days ago, our team needs to configure the Gradle's build scripts to auto build the project. Here is the requirement, to build three versions of app, release, development and test, from the command line. I found the ways from the following link, http://stackoverflow.com/questions/17197636/is-it-possible-to-declare-a-variable-in-gradle-usable-in-java Actually, we can generate the Java constants and Android resources from the Gradle's build script: 1 Generate Java Constants android { buildTypes { debug { buildConfigField "int" , "FOO" , "42" buildConfigField "String" , "FOO_STRING" , "\"foo\"" } release { buildConfigField "int" , "FOO" , "52" ...