Refactor naming according to convention

Change-Id: Id74e2495d5909e4978247e0d7edfb5621b2064ff
pull/458/head
mlykotom 2 years ago
parent 9c22af19eb
commit 7db33aa041

@ -14,7 +14,7 @@
* limitations under the License.
*/
import com.google.samples.apps.nowinandroid.FlavorDimension
import com.google.samples.apps.nowinandroid.NiAFlavor
import com.google.samples.apps.nowinandroid.NiaFlavor
/*
* Copyright 2022 The Android Open Source Project
@ -44,7 +44,7 @@ android {
// The UI catalog does not depend on content from the app, however, it depends on modules
// which do, so we must specify a default value for the contentType dimension.
missingDimensionStrategy(FlavorDimension.contentType.name, NiAFlavor.demo.name)
missingDimensionStrategy(FlavorDimension.contentType.name, NiaFlavor.demo.name)
}
packagingOptions {

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import com.google.samples.apps.nowinandroid.NiABuildType
import com.google.samples.apps.nowinandroid.NiaBuildType
plugins {
id("nowinandroid.android.application")
@ -39,11 +39,11 @@ android {
buildTypes {
val debug by getting {
applicationIdSuffix = NiABuildType.DEBUG.applicationIdSuffix
applicationIdSuffix = NiaBuildType.DEBUG.applicationIdSuffix
}
val release by getting {
isMinifyEnabled = true
applicationIdSuffix = NiABuildType.RELEASE.applicationIdSuffix
applicationIdSuffix = NiaBuildType.RELEASE.applicationIdSuffix
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
// To publish on the Play store a private signing key is required, but to allow anyone
@ -60,7 +60,7 @@ android {
// Only use benchmark proguard rules
proguardFiles("benchmark-rules.pro")
isMinifyEnabled = true
applicationIdSuffix = NiABuildType.BENCHMARK.applicationIdSuffix
applicationIdSuffix = NiaBuildType.BENCHMARK.applicationIdSuffix
}
}

@ -14,7 +14,7 @@
* limitations under the License.
*/
import com.android.build.api.dsl.ManagedVirtualDevice
import com.google.samples.apps.nowinandroid.NiABuildType
import com.google.samples.apps.nowinandroid.NiaBuildType
import com.google.samples.apps.nowinandroid.configureFlavors
plugins {
@ -47,7 +47,7 @@ android {
buildConfigField(
"String",
"APP_BUILD_TYPE_SUFFIX",
"\"${NiABuildType.BENCHMARK.applicationIdSuffix ?: ""}\""
"\"${NiaBuildType.BENCHMARK.applicationIdSuffix ?: ""}\""
)
}
}

@ -20,7 +20,7 @@ package com.google.samples.apps.nowinandroid
* This is shared between :app and :benchmarks module to provide configurations type safety.
*/
@Suppress("unused")
enum class NiABuildType(val applicationIdSuffix: String? = null) {
enum class NiaBuildType(val applicationIdSuffix: String? = null) {
DEBUG(".debug"),
RELEASE,
BENCHMARK(".benchmark")

@ -15,19 +15,19 @@ enum class FlavorDimension {
// purposes, or from a production backend server which supplies up-to-date, real content.
// These two product flavors reflect this behaviour.
@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),
prod(FlavorDimension.contentType, ".prod")
}
fun Project.configureFlavors(
commonExtension: CommonExtension<*, *, *, *>,
flavorConfigurationBlock: ProductFlavor.(flavor: NiAFlavor) -> Unit = {}
flavorConfigurationBlock: ProductFlavor.(flavor: NiaFlavor) -> Unit = {}
) {
commonExtension.apply {
flavorDimensions += FlavorDimension.contentType.name
productFlavors {
NiAFlavor.values().forEach {
NiaFlavor.values().forEach {
create(it.name) {
dimension = it.dimension.name
flavorConfigurationBlock(this, it)
Loading…
Cancel
Save