Skip to content

fix(all): Upgrade Compose to latest BOM #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions authenticator-screenshots/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ android {
}

dependencies {
implementation(platform(libs.androidx.compose.bom))

implementation(libs.bundles.compose)
implementation(libs.test.mockk)
implementation(projects.authenticator)
Expand Down
2 changes: 2 additions & 0 deletions authenticator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ android {
}

dependencies {
implementation(platform(libs.androidx.compose.bom))

api(libs.amplify.auth)

implementation(libs.bundles.compose)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fun PasswordResetConfirm(
.padding(horizontal = 16.dp)
) {
headerContent(state)
deliveryNoticeContent(details = state.deliveryDetails)
deliveryNoticeContent(state.deliveryDetails)
AuthenticatorForm(
state = state.form
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.Divider
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.ModalBottomSheet
Expand Down Expand Up @@ -70,10 +70,7 @@ import java.util.Locale
import kotlinx.coroutines.launch

@Stable
private class PhoneNumberFieldState(
initialRegionCode: String,
initialNumber: String = ""
) {
private class PhoneNumberFieldState(initialRegionCode: String, initialNumber: String = "") {
var region by mutableStateOf(regionMap[initialRegionCode] ?: regionMap["US"]!!)
var number by mutableStateOf(initialNumber)
var expanded by mutableStateOf(false)
Expand Down Expand Up @@ -137,9 +134,7 @@ internal fun PhoneInputField(

@OptIn(ExperimentalMaterial3Api::class)
@Composable
private fun DialCodeSelector(
state: PhoneNumberFieldState
) {
private fun DialCodeSelector(state: PhoneNumberFieldState) {
Text(
modifier = Modifier
.clickable { state.expanded = true }
Expand Down Expand Up @@ -195,11 +190,7 @@ private fun DialCodeSelector(
}

@Composable
private fun RegionSearchBox(
value: String,
onValueChange: (String) -> Unit,
modifier: Modifier = Modifier
) {
private fun RegionSearchBox(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier) {
OutlinedTextField(
modifier = modifier,
value = value,
Expand Down Expand Up @@ -227,11 +218,7 @@ private fun RegionSearchBox(
}

@Composable
private fun LazyItemScope.RegionItem(
showDivider: Boolean,
region: Region,
onClick: (Region) -> Unit
) {
private fun LazyItemScope.RegionItem(showDivider: Boolean, region: Region, onClick: (Region) -> Unit) {
Row(
modifier = Modifier
.fillParentMaxWidth()
Expand All @@ -249,6 +236,6 @@ private fun LazyItemScope.RegionItem(
}

if (showDivider) {
Divider(modifier = Modifier.padding(horizontal = 16.dp))
HorizontalDivider(modifier = Modifier.padding(horizontal = 16.dp))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ class LicensesConventionPlugin : Plugin<Project> {
allowUrl("http://aws.amazon.com/apache2.0")
allowUrl("https://developer.android.com/studio/terms.html")

ignoreDependencies("javax.annotation", "javax.annotation-api") {
because("Transitive dependency for androidx.test.espresso:espresso-core")
}
ignoreDependencies("org.junit", "junit-bom") {
because("Unit Testing Dependency")
}
Expand Down
47 changes: 28 additions & 19 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
[versions]
agp = "8.1.4"
agp = "8.7.2"
amplify = "2.27.0"
androidx-junit = "1.1.4"
binary-compatibility = "0.14.0"
cameraX = "1.2.0"
compose = "1.5.4"
compose-bom = "2025.03.01"
coroutines = "1.7.3"
desugar = "1.2.0"
futures = "1.1.0"
junit = "4.13.2"
kotest = "5.7.1"
kotlin = "1.9.10"
kover = "0.7.2"
ktlint = "11.0.0"
licensee = "1.7.0"
lifecycle = "2.4.0"
material3 = "1.1.2"
mockk = "1.13.4"
paparazzi = "1.2.0"
robolectric = "4.9.2"
serialization = "1.3.3"
tensorflow = "2.0.0"
tensorflow-support = "0.3.0"
turbine = "1.0.0"
zxing = "3.5.2"

Expand All @@ -23,38 +31,40 @@ amplify-auth = { module = "com.amplifyframework:aws-auth-cognito", version.ref =
amplify-predictions = { module = "com.amplifyframework:aws-predictions", version.ref = "amplify" }

# Android
android-desugar = "com.android.tools:desugar_jdk_libs:1.1.8"
android-desugar = { module = "com.android.tools:desugar_jdk_libs", version.ref = "desugar" }

# AndroidX
androidx-camera-core = { module = "androidx.camera:camera-core", version.ref = "cameraX" }
androidx-camera-camera2 = { module = "androidx.camera:camera-camera2", version.ref = "cameraX" }
androidx-camera-lifecycle = { module = "androidx.camera:camera-lifecycle", version.ref = "cameraX" }
androidx-compose-material = { module = "androidx.compose.material3:material3", version.ref = "material3" }
androidx-compose-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycle" }
androidx-compose-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
androidx-futures = "androidx.concurrent:concurrent-futures:1.1.0"
androidx-futures = { module = "androidx.concurrent:concurrent-futures", version.ref = "futures" }
androidx-lifecycle = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle" }
androidx-compose-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycle" }

# Compose
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "compose-bom" }
androidx-compose-material = { module = "androidx.compose.material3:material3" }
androidx-compose-tooling = { module = "androidx.compose.ui:ui-tooling" }

# Kotlin
kotlin-serialization-json = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3"
kotlin-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }

# TensorFlow
tensorflow = "org.tensorflow:tensorflow-lite:2.0.0"
tensorflow-support = "org.tensorflow:tensorflow-lite-support:0.3.0"
tensorflow = { module = "org.tensorflow:tensorflow-lite", version.ref = "tensorflow" }
tensorflow-support = {module = "org.tensorflow:tensorflow-lite-support", version.ref = "tensorflow-support" }

# Other
zxing = { module = "com.google.zxing:core", version.ref = "zxing" }

# Testing libraries
test-androidx-junit = "androidx.test.ext:junit:1.1.4"
test-compose-junit = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose" }
test-compose-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "compose" }
test-androidx-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-junit" }
test-compose-junit = { module = "androidx.compose.ui:ui-test-junit4" }
test-compose-manifest = { module = "androidx.compose.ui:ui-test-manifest" }
test-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
test-espresso = "androidx.test.espresso:espresso-core:3.5.1"
test-junit = "junit:junit:4.13.2"
test-junit = { module = "junit:junit", version.ref = "junit" }
test-kotest-assertions = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
test-mockk = "io.mockk:mockk:1.13.4"
test-robolectric = "org.robolectric:robolectric:4.9.2"
test-mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
test-robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
test-turbine = { module = "app.cash.turbine:turbine", version.ref = "turbine" }

# Dependencies for convention plugins
Expand All @@ -75,7 +85,6 @@ test = [
"test-robolectric",
"test-compose-junit",
"test-compose-manifest",
"test-espresso",
"test-coroutines",
"test-kotest-assertions",
"test-turbine"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
7 changes: 7 additions & 0 deletions liveness/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ android {
androidResources {
noCompress += "tflite"
}

compileOptions {
isCoreLibraryDesugaringEnabled = true
}
}

dependencies {
implementation(platform(libs.androidx.compose.bom))

api(libs.amplify.api)
api(libs.amplify.predictions)
Expand All @@ -56,5 +61,7 @@ dependencies {
implementation(libs.tensorflow)
implementation(libs.tensorflow.support)

coreLibraryDesugaring(libs.android.desugar)

testImplementation(projects.testing)
}
4 changes: 2 additions & 2 deletions samples/authenticator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.1.4' apply false
id 'com.android.library' version '8.1.4' apply false
id 'com.android.application' version '8.7.2' apply false
id 'com.android.library' version '8.7.2' apply false
id 'org.jetbrains.kotlin.android' version '1.9.10' apply false
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions samples/liveness/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ buildscript {
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.1.4' apply false
id 'com.android.library' version '8.1.4' apply false
id 'com.android.application' version '8.7.2' apply false
id 'com.android.library' version '8.7.2' apply false
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.10' apply false
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 2 additions & 0 deletions testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ android {
}

dependencies {
implementation(platform(libs.androidx.compose.bom))

api(libs.bundles.test)
implementation(libs.bundles.compose)
}