From 193b376fe3ef979d7a8ef900f7411b9391d17a04 Mon Sep 17 00:00:00 2001 From: Carter Jernigan Date: Tue, 17 Jan 2023 11:43:22 -0500 Subject: [PATCH] [#581] Switch to Play app update library Co-authored-by: Honza --- app/proguard-project.txt | 8 ++- gradle.properties | 4 +- settings.gradle.kts | 99 ++++++++++++++++++---------- ui-integration-test/build.gradle.kts | 2 +- ui-lib/build.gradle.kts | 2 +- ui-screenshot-test/build.gradle.kts | 2 +- 6 files changed, 76 insertions(+), 41 deletions(-) diff --git a/app/proguard-project.txt b/app/proguard-project.txt index d354540b..7060f295 100644 --- a/app/proguard-project.txt +++ b/app/proguard-project.txt @@ -9,12 +9,16 @@ # Generate the combined proguard configuration for debugging. -printconfiguration build/outputs/proguard-config.txt --dontwarn javax.naming.NamingEnumeration --dontwarn javax.naming.NamingException +-dontwarn androidx.compose.ui.util.MathHelpersKt +-dontwarn com.google.common.util.concurrent.ListenableFuture +-dontwarn com.google.errorprone.annotations.InlineMe +-dontwarn com.google.errorprone.annotations.MustBeClosed -dontwarn javax.naming.directory.Attribute -dontwarn javax.naming.directory.Attributes -dontwarn javax.naming.directory.DirContext -dontwarn javax.naming.directory.InitialDirContext +-dontwarn javax.naming.NamingEnumeration +-dontwarn javax.naming.NamingException # kotlinx.datetime supports kotlinx.serialization, but we don't use kotlinx.serialization elsewhere # in the projects, so the classes aren't present. These warnings are safe to suppress. diff --git a/gradle.properties b/gradle.properties index 3e0cd116..d7f7b375 100644 --- a/gradle.properties +++ b/gradle.properties @@ -139,8 +139,8 @@ KOTLIN_VERSION=1.7.21 KOTLINX_COROUTINES_VERSION=1.6.4 KOTLINX_DATETIME_VERSION=0.4.0 KOVER_VERSION=0.5.1 -PLAY_CORE_VERSION=1.10.3 -PLAY_CORE_KTX_VERSION=1.8.1 +PLAY_APP_UPDATE_VERSION=2.0.1 +PLAY_APP_UPDATE_KTX_VERSION=2.0.1 ZCASH_ANDROID_WALLET_PLUGINS_VERSION=1.0.0 ZCASH_BIP39_VERSION=1.0.4 # TODO [#279]: Revert to stable SDK before app release diff --git a/settings.gradle.kts b/settings.gradle.kts index b9223fe2..5b718d93 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,34 +4,48 @@ pluginManagement { repositories { val isRepoRestrictionEnabled = true + val googleGroups = listOf( + "androidx.navigation", + "com.android.tools", + "com.google.testing.platform" + ) + val googleRegexes = listOf( + "androidx.*", + "com\\.android.*", + "com\\.android\\.tools.*" + ) + val wtfGroups = listOf("wtf.emulator") + mavenCentral { if (isRepoRestrictionEnabled) { content { - includeGroup("wtf.emulator") + wtfGroups.forEach { + includeGroup(it) + } } } } google { if (isRepoRestrictionEnabled) { content { - includeGroup("androidx.navigation") - includeGroup("com.android.tools") - includeGroup("com.google.testing.platform") - includeGroupByRegex("androidx.*") - includeGroupByRegex("com\\.android.*") - includeGroupByRegex("com\\.android\\.tools.*") + googleGroups.forEach { + includeGroup(it) + } + googleRegexes.forEach { + includeGroupByRegex(it) + } } } } gradlePluginPortal { if (isRepoRestrictionEnabled) { content { - excludeGroup("androidx.navigation") - excludeGroup("com.android.tools") - excludeGroup("com.google.testing.platform") - excludeGroupByRegex("androidx.*") - excludeGroupByRegex("com\\.android.*") - excludeGroupByRegex("com\\.android\\.tools.*") + (wtfGroups + googleGroups).forEach { + excludeGroup(it) + } + googleRegexes.forEach { + excludeGroupByRegex(it) + } } } } @@ -63,29 +77,46 @@ dependencyResolutionManagement { repositories { val isRepoRestrictionEnabled = true + val googleGroups = listOf( + "androidx.benchmark", + "androidx.navigation", + "com.android.tools", + "com.google.android.datatransport", + "com.google.android.gms", + "com.google.android.material", + "com.google.android.play", + "com.google.firebase", + "com.google.testing.platform", + "com.google.android.apps.common.testing.accessibility.framework" + ) + val googleRegexes = listOf( + "androidx.*", + "com\\.android.*", + "com\\.android\\.tools.*" + ) + val wtfGroups = listOf("wtf.emulator") + google { if (isRepoRestrictionEnabled) { content { - includeGroup("android.arch.core") - includeGroup("android.arch.lifecycle") - includeGroup("com.google.android.material") - includeGroup("com.google.testing.platform") - includeGroup("com.google.android.play") - includeGroupByRegex("androidx.*") - includeGroupByRegex("com\\.android.*") + googleGroups.forEach { + includeGroup(it) + } + googleRegexes.forEach { + includeGroupByRegex(it) + } } } } mavenCentral { if (isRepoRestrictionEnabled) { content { - excludeGroup("android.arch.lifecycle") - excludeGroup("android.arch.core") - excludeGroup("wtf.emulator") - excludeGroup("com.google.android.material") - excludeGroup("com.google.android.play") - excludeGroupByRegex("androidx.*") - excludeGroupByRegex("com\\.android.*") + (wtfGroups + googleGroups).forEach { + excludeGroup(it) + } + googleRegexes.forEach { + excludeGroupByRegex(it) + } } } } @@ -142,8 +173,8 @@ dependencyResolutionManagement { val kotlinVersion = extra["KOTLIN_VERSION"].toString() val kotlinxDateTimeVersion = extra["KOTLINX_DATETIME_VERSION"].toString() val kotlinxCoroutinesVersion = extra["KOTLINX_COROUTINES_VERSION"].toString() - val playCoreVersion = extra["PLAY_CORE_VERSION"].toString() - val playCoreKtxVersion = extra["PLAY_CORE_KTX_VERSION"].toString() + val playAppUpdateVersion = extra["PLAY_APP_UPDATE_VERSION"].toString() + val playAppUpdateKtxVersion = extra["PLAY_APP_UPDATE_KTX_VERSION"].toString() val zcashBip39Version = extra["ZCASH_BIP39_VERSION"].toString() val zcashSdkVersion = extra["ZCASH_SDK_VERSION"].toString() val zxingVersion = extra["ZXING_VERSION"].toString() @@ -189,8 +220,8 @@ dependencyResolutionManagement { library("kotlinx-coroutines-core", "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion") library("kotlinx-coroutines-guava", "org.jetbrains.kotlinx:kotlinx-coroutines-guava:$kotlinxCoroutinesVersion") library("kotlinx-datetime", "org.jetbrains.kotlinx:kotlinx-datetime:$kotlinxDateTimeVersion") - library("play-core", "com.google.android.play:core:$playCoreVersion") - library("play-core-ktx", "com.google.android.play:core-ktx:$playCoreKtxVersion") + library("play-update", "com.google.android.play:app-update:$playAppUpdateVersion") + library("play-update-ktx", "com.google.android.play:app-update-ktx:$playAppUpdateKtxVersion") library("zcash-sdk", "cash.z.ecc.android:zcash-android-sdk:$zcashSdkVersion") library("zcash-bip39", "cash.z.ecc.android:kotlin-bip39:$zcashBip39Version") library("zcash-walletplgns", "cash.z.ecc.android:zcash-android-wallet-plugins:$zcashBip39Version") @@ -243,10 +274,10 @@ dependencyResolutionManagement { ) ) bundle( - "play-core", + "play-update", listOf( - "play-core", - "play-core-ktx", + "play-update", + "play-update-ktx", ) ) bundle( diff --git a/ui-integration-test/build.gradle.kts b/ui-integration-test/build.gradle.kts index 4b0ffad8..1210ef4f 100644 --- a/ui-integration-test/build.gradle.kts +++ b/ui-integration-test/build.gradle.kts @@ -63,7 +63,7 @@ dependencies { implementation(libs.bundles.androidx.test) implementation(libs.bundles.androidx.compose.core) - implementation(libs.bundles.play.core) + implementation(libs.bundles.play.update) implementation(libs.androidx.compose.test.junit) implementation(libs.androidx.navigation.compose) diff --git a/ui-lib/build.gradle.kts b/ui-lib/build.gradle.kts index 99dd11ae..f85de9a3 100644 --- a/ui-lib/build.gradle.kts +++ b/ui-lib/build.gradle.kts @@ -66,7 +66,7 @@ dependencies { implementation(libs.bundles.androidx.camera) implementation(libs.bundles.androidx.compose.core) implementation(libs.bundles.androidx.compose.extended) - implementation(libs.bundles.play.core) + implementation(libs.bundles.play.update) implementation(libs.kotlin.stdlib) implementation(libs.kotlinx.coroutines.android) implementation(libs.kotlinx.coroutines.core) diff --git a/ui-screenshot-test/build.gradle.kts b/ui-screenshot-test/build.gradle.kts index 41a64bce..ff31e490 100644 --- a/ui-screenshot-test/build.gradle.kts +++ b/ui-screenshot-test/build.gradle.kts @@ -63,7 +63,7 @@ dependencies { implementation(libs.bundles.androidx.test) implementation(libs.bundles.androidx.compose.core) - implementation(libs.bundles.play.core) + implementation(libs.bundles.play.update) implementation(libs.androidx.compose.test.junit) implementation(libs.androidx.navigation.compose)