|
|
|
@ -13,19 +13,19 @@ enum class FlavorDimension {
|
|
|
|
|
// The content for the app can either come from local static data which is useful for demo
|
|
|
|
|
// purposes, or from a production backend server which supplies up-to-date, real content.
|
|
|
|
|
// These two product flavors reflect this behaviour.
|
|
|
|
|
enum class Flavor(val dimension: FlavorDimension, val applicationIdSuffix: String? = null) {
|
|
|
|
|
demo(FlavorDimension.contentType),
|
|
|
|
|
prod(FlavorDimension.contentType, ".prod")
|
|
|
|
|
enum class NiAFlavor(val dimension: FlavorDimension, val applicationIdSuffix: String? = null) {
|
|
|
|
|
DEMO(FlavorDimension.contentType),
|
|
|
|
|
PROD(FlavorDimension.contentType, ".prod")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun Project.configureFlavors(
|
|
|
|
|
commonExtension: CommonExtension<*, *, *, *>,
|
|
|
|
|
flavorConfigurationBlock: ProductFlavor.(flavor: Flavor) -> Unit = {}
|
|
|
|
|
flavorConfigurationBlock: ProductFlavor.(flavor: NiAFlavor) -> Unit = {}
|
|
|
|
|
) {
|
|
|
|
|
commonExtension.apply {
|
|
|
|
|
flavorDimensions += FlavorDimension.contentType.name
|
|
|
|
|
productFlavors {
|
|
|
|
|
Flavor.values().forEach {
|
|
|
|
|
NiAFlavor.values().forEach {
|
|
|
|
|
create(it.name) {
|
|
|
|
|
dimension = it.dimension.name
|
|
|
|
|
flavorConfigurationBlock(this, it)
|