I can't use the comment (too long). You can find it in the what's new in gradle 1.9.
DSL Changes:
buildConfigLine
is replaced bybuildConfigField
:buildConfigField "boolean", "MY_FLAG", "true"
You can override fields defined in default config in flavors or build types. See 'basic' sample.
Build Config also now automatically contain more constants for
PACKAGE_NAME
,VERSION_CODE
,VERSION_NAME
,BUILD_TYPE
,FLAVOR
as well asFLAVOR_<group>
if there are several flavor dimensions.
So if you have a line like this:
buildConfig "public static final boolean MY_FLAG = true;"
You should now replace it for something like this:
buildConfigField "boolean", "MY_FLAG", "true"
In your case:
buildConfigField "String" , "MY_KEY" , "\"XXXXX-XXXXX-XXX\""
UPDATE 12/09/2015:
With the new experimental plugin (0.2.1) you have to use:
buildConfigFields.with {
create() {
type = "String"
name = "MY_KEY"
value = "MY_VALUE"
}
}