environmentBuildConfig

fun environmentBuildConfig(environments: List<String>, defaultDebugEnvironment: String, defaultReleaseEnvironment: String, fallbackEnvironment: String)

Generates build config fields and res values for the given defaultDebugEnvironment and all given environments in the debug build type and only for the given defaultReleaseEnvironment in the release build type.

Both defaultDebugEnvironment and defaultReleaseEnvironment can be overridden dynamically by passing fgp.injectBuildEnvironment as property.

For this it will find all Gradle properties starting with fgp.app.config, fgp.{app-name}.config, fgp.app.res and fgp.{app-name}.res and uses them for this purpose. The former 2 will result in build config fields, the latter 2 in res values. Properties will then also be filtered for each environment by using the name of the environment as a suffix. fallbackEnvironment will be used for filtering if environments does not contain the default environment.

If the value of a property contains {environment} that value will be replaced with the name of the environment.

The name of the result variable is a combination of the environment name and the part of the Gradle property name between the prefix and suffix. For the default environments DEFAULT is used instead of the actual environment For example fpg.app.config.google.client_id.production with DEFAULT as environmentName will result in DEFAULT_GOOGLE_CLIENT_ID.