|
|
@ -16,7 +16,7 @@ enum class FlavorDimension {
|
|
|
|
@Suppress("EnumEntryName")
|
|
|
|
@Suppress("EnumEntryName")
|
|
|
|
enum class NiaFlavor(val dimension: FlavorDimension, val applicationIdSuffix: String? = null) {
|
|
|
|
enum class NiaFlavor(val dimension: FlavorDimension, val applicationIdSuffix: String? = null) {
|
|
|
|
demo(FlavorDimension.contentType, applicationIdSuffix = ".demo"),
|
|
|
|
demo(FlavorDimension.contentType, applicationIdSuffix = ".demo"),
|
|
|
|
prod(FlavorDimension.contentType)
|
|
|
|
prod(FlavorDimension.contentType),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun configureFlavors(
|
|
|
|
fun configureFlavors(
|
|
|
@ -24,18 +24,18 @@ fun configureFlavors(
|
|
|
|
flavorConfigurationBlock: ProductFlavor.(flavor: NiaFlavor) -> Unit = {},
|
|
|
|
flavorConfigurationBlock: ProductFlavor.(flavor: NiaFlavor) -> Unit = {},
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
commonExtension.apply {
|
|
|
|
commonExtension.apply {
|
|
|
|
FlavorDimension.values().forEach {
|
|
|
|
FlavorDimension.values().forEach { flavorDimension ->
|
|
|
|
flavorDimensions += it.name
|
|
|
|
flavorDimensions += flavorDimension.name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
productFlavors {
|
|
|
|
productFlavors {
|
|
|
|
NiaFlavor.values().forEach {
|
|
|
|
NiaFlavor.values().forEach { niaFlavor ->
|
|
|
|
register(it.name) {
|
|
|
|
register(niaFlavor.name) {
|
|
|
|
dimension = it.dimension.name
|
|
|
|
dimension = niaFlavor.dimension.name
|
|
|
|
flavorConfigurationBlock(this, it)
|
|
|
|
flavorConfigurationBlock(this, niaFlavor)
|
|
|
|
if (this@apply is ApplicationExtension && this is ApplicationProductFlavor) {
|
|
|
|
if (this@apply is ApplicationExtension && this is ApplicationProductFlavor) {
|
|
|
|
if (it.applicationIdSuffix != null) {
|
|
|
|
if (niaFlavor.applicationIdSuffix != null) {
|
|
|
|
applicationIdSuffix = it.applicationIdSuffix
|
|
|
|
applicationIdSuffix = niaFlavor.applicationIdSuffix
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|