Skip to content

Commit d7ab522

Browse files
authored
chore(samples): Update the liveness sample app to use the latest compose bom (#224)
1 parent ffcdab9 commit d7ab522

File tree

4 files changed

+46
-22
lines changed

4 files changed

+46
-22
lines changed

gradle/libs.versions.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
[versions]
2+
accompanist = "0.28.0"
23
agp = "8.7.2"
34
amplify = "2.27.0"
5+
appcompat = "1.6.1"
6+
androidx-core = "1.9.0"
47
androidx-junit = "1.1.4"
8+
androidx-activity = "1.6.1"
9+
androidx-navigation = "2.5.3"
510
binary-compatibility = "0.14.0"
611
cameraX = "1.2.0"
712
compose-bom = "2025.03.01"
@@ -26,6 +31,7 @@ zxing = "3.5.2"
2631

2732
[libraries]
2833
# Amplify Dependencies
34+
amplify-core-kotlin = { module = "com.amplifyframework:core-kotlin", version.ref = "amplify" }
2935
amplify-api = { module = "com.amplifyframework:aws-api", version.ref = "amplify" }
3036
amplify-auth = { module = "com.amplifyframework:aws-auth-cognito", version.ref = "amplify" }
3137
amplify-predictions = { module = "com.amplifyframework:aws-predictions", version.ref = "amplify" }
@@ -34,27 +40,36 @@ amplify-predictions = { module = "com.amplifyframework:aws-predictions", version
3440
android-desugar = { module = "com.android.tools:desugar_jdk_libs", version.ref = "desugar" }
3541

3642
# AndroidX
43+
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
44+
androidx-core = { module = "androidx.core:core-ktx", version.ref = "androidx-core" }
3745
androidx-camera-core = { module = "androidx.camera:camera-core", version.ref = "cameraX" }
3846
androidx-camera-camera2 = { module = "androidx.camera:camera-camera2", version.ref = "cameraX" }
3947
androidx-camera-lifecycle = { module = "androidx.camera:camera-lifecycle", version.ref = "cameraX" }
4048
androidx-futures = { module = "androidx.concurrent:concurrent-futures", version.ref = "futures" }
4149
androidx-lifecycle = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle" }
4250
androidx-compose-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycle" }
51+
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
52+
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidx-navigation" }
4353

4454
# Compose
4555
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "compose-bom" }
4656
androidx-compose-material = { module = "androidx.compose.material3:material3" }
4757
androidx-compose-tooling = { module = "androidx.compose.ui:ui-tooling" }
58+
androidx-compose-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
59+
androidx-compose-ui = { module = "androidx.compose.ui:ui" }
60+
androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }
4861

4962
# Kotlin
5063
kotlin-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }
64+
kotlin-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
5165

5266
# TensorFlow
5367
tensorflow = { module = "org.tensorflow:tensorflow-lite", version.ref = "tensorflow" }
5468
tensorflow-support = {module = "org.tensorflow:tensorflow-lite-support", version.ref = "tensorflow-support" }
5569

5670
# Other
5771
zxing = { module = "com.google.zxing:core", version.ref = "zxing" }
72+
accompanist = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist" }
5873

5974
# Testing libraries
6075
test-androidx-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-junit" }

samples/liveness/app/build.gradle

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ android {
3030
}
3131
}
3232
compileOptions {
33+
coreLibraryDesugaringEnabled true
3334
sourceCompatibility JavaVersion.VERSION_1_8
3435
targetCompatibility JavaVersion.VERSION_1_8
3536
}
@@ -40,7 +41,7 @@ android {
4041
compose true
4142
}
4243
composeOptions {
43-
kotlinCompilerExtensionVersion '1.4.3'
44+
kotlinCompilerExtensionVersion '1.5.3'
4445
}
4546
packaging {
4647
resources {
@@ -60,22 +61,27 @@ dependencies {
6061
// Use this to use published version of Amplify UI
6162
implementation "com.amplifyframework.ui:liveness:$LivenessVersion"
6263

63-
implementation "com.amplifyframework:core-kotlin:$amplifyVersion"
64-
implementation "com.amplifyframework:aws-api:$amplifyVersion"
65-
implementation "com.amplifyframework:aws-auth-cognito:$amplifyVersion"
66-
implementation "com.amplifyframework:aws-predictions:$amplifyVersion"
64+
implementation libs.amplify.core.kotlin
65+
implementation libs.amplify.api
66+
implementation libs.amplify.auth
67+
implementation libs.amplify.predictions
6768

68-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
69-
implementation "com.google.accompanist:accompanist-permissions:0.28.0"
70-
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3'
71-
implementation 'androidx.core:core-ktx:1.9.0'
72-
implementation 'androidx.navigation:navigation-compose:2.5.3'
73-
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
74-
implementation 'androidx.activity:activity-compose:1.6.1'
75-
implementation "androidx.compose.ui:ui:$compose_version"
76-
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
77-
implementation 'androidx.compose.material3:material3:1.1.0'
78-
implementation 'androidx.appcompat:appcompat:1.6.1'
79-
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
80-
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
69+
implementation platform(libs.androidx.compose.bom)
70+
71+
implementation libs.accompanist
72+
implementation libs.kotlin.coroutines
73+
implementation libs.kotlin.serialization.json
74+
implementation libs.androidx.core
75+
implementation libs.androidx.navigation.compose
76+
implementation libs.androidx.lifecycle
77+
implementation libs.androidx.activity.compose
78+
implementation libs.androidx.compose.ui
79+
implementation libs.androidx.compose.tooling.preview
80+
implementation libs.androidx.compose.material
81+
implementation libs.androidx.appcompat
82+
83+
coreLibraryDesugaring libs.android.desugar
84+
85+
debugImplementation libs.androidx.compose.tooling
86+
debugImplementation libs.androidx.compose.ui.test.manifest
8187
}

samples/liveness/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
buildscript {
22
ext {
3-
compose_version = '1.5.4'
4-
amplifyVersion = '2.15.1'
53
LivenessVersion = '1.4.0'
64
}
75
repositories {
@@ -11,6 +9,6 @@ buildscript {
119
plugins {
1210
id 'com.android.application' version '8.7.2' apply false
1311
id 'com.android.library' version '8.7.2' apply false
14-
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
15-
id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.10' apply false
12+
id 'org.jetbrains.kotlin.android' version '1.9.10' apply false
13+
id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.10' apply false
1614
}

samples/liveness/settings.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ dependencyResolutionManagement {
1111
repositories {
1212
google()
1313
mavenCentral()
14+
15+
versionCatalogs {
16+
create("libs") {
17+
from(files("../../gradle/libs.versions.toml"))
18+
}
1419
}
1520
}
1621
rootProject.name = "Liveness-Sample"

0 commit comments

Comments
 (0)