An alternative approach is to use conditionals in your defaultConfig:
defaultConfig {
buildConfigField("Boolean", "MY_FLAVOR", "FLAVOR == \"my_flavor\"")
}
will produce some like this:
// Field from default config.
public static final Boolean MY_FLAVOR = FLAVOR == "my_flavor";