Refactor to improve `FlavorDimension` extensibility, and replace to `register` lazy api.

Change-Id: I6e2980f19da5a6e22a7773c84493424663e33fc4
pull/1532/head
Jaehwa Noh 6 months ago
parent c0f9660b39
commit 65d7e4519e

@ -21,13 +21,16 @@ enum class NiaFlavor(val dimension: FlavorDimension, val applicationIdSuffix: St
fun configureFlavors( fun configureFlavors(
commonExtension: CommonExtension<*, *, *, *, *, *>, commonExtension: CommonExtension<*, *, *, *, *, *>,
flavorConfigurationBlock: ProductFlavor.(flavor: NiaFlavor) -> Unit = {} flavorConfigurationBlock: ProductFlavor.(flavor: NiaFlavor) -> Unit = {},
) { ) {
commonExtension.apply { commonExtension.apply {
flavorDimensions += FlavorDimension.contentType.name FlavorDimension.values().forEach {
flavorDimensions += it.name
}
productFlavors { productFlavors {
NiaFlavor.values().forEach { NiaFlavor.values().forEach {
create(it.name) { register(it.name) {
dimension = it.dimension.name dimension = it.dimension.name
flavorConfigurationBlock(this, it) flavorConfigurationBlock(this, it)
if (this@apply is ApplicationExtension && this is ApplicationProductFlavor) { if (this@apply is ApplicationExtension && this is ApplicationProductFlavor) {

Loading…
Cancel
Save