From 7db33aa041aa0c81c9dd22c9d4ddceb9d8894b37 Mon Sep 17 00:00:00 2001 From: mlykotom Date: Tue, 29 Nov 2022 19:10:23 +0100 Subject: [PATCH] Refactor naming according to convention Change-Id: Id74e2495d5909e4978247e0d7edfb5621b2064ff --- app-nia-catalog/build.gradle.kts | 4 ++-- app/build.gradle.kts | 8 ++++---- benchmarks/build.gradle.kts | 4 ++-- .../nowinandroid/{NiABuildType.kt => NiaBuildType.kt} | 2 +- .../apps/nowinandroid/{NiAFlavor.kt => NiaFlavor.kt} | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) rename build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/{NiABuildType.kt => NiaBuildType.kt} (93%) rename build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/{NiAFlavor.kt => NiaFlavor.kt} (89%) diff --git a/app-nia-catalog/build.gradle.kts b/app-nia-catalog/build.gradle.kts index 87d591d36..8232350d9 100644 --- a/app-nia-catalog/build.gradle.kts +++ b/app-nia-catalog/build.gradle.kts @@ -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 { diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a6cad9892..c3d4a9af2 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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 } } diff --git a/benchmarks/build.gradle.kts b/benchmarks/build.gradle.kts index ab7f6ac0c..5b706db4f 100644 --- a/benchmarks/build.gradle.kts +++ b/benchmarks/build.gradle.kts @@ -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 ?: ""}\"" ) } } diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiABuildType.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaBuildType.kt similarity index 93% rename from build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiABuildType.kt rename to build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaBuildType.kt index 4b721a56a..454036782 100644 --- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiABuildType.kt +++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaBuildType.kt @@ -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") diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiAFlavor.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaFlavor.kt similarity index 89% rename from build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiAFlavor.kt rename to build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaFlavor.kt index 3421b6a3e..5cafdf7ce 100644 --- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiAFlavor.kt +++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaFlavor.kt @@ -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)