@@ -62,7 +62,8 @@ android {
6262 proguardFiles(getDefaultProguardFile(" proguard-android-optimize.txt" ), " proguard-rules.pro" )
6363 }
6464 named(" debug" ) {
65- isTestCoverageEnabled = true
65+ enableUnitTestCoverage = true
66+ enableAndroidTestCoverage = true
6667 }
6768 }
6869
@@ -94,8 +95,7 @@ android {
9495}
9596
9697jacoco {
97- val jacoco_version: String by project
98- toolVersion = jacoco_version
98+ toolVersion = libs.versions.jacoco.get()
9999 reportsDirectory.set(layout.buildDirectory.dir(" mergedReportDir" ))
100100}
101101
@@ -216,82 +216,70 @@ fun loadKeyStore(name: String): Properties? {
216216 }
217217}
218218
219- val firebase_bom_version: String by project
220- val hilt_version: String by project
221- val coroutines_version: String by project
222- val material_version: String by project
223- val mockk_version: String by project
224219dependencies {
225220
226- implementation(" androidx.appcompat:appcompat:1.7.0" )
227- implementation(" androidx.core:core-ktx:1.16.0" )
228- implementation(" androidx.constraintlayout:constraintlayout:2.2.1" )
221+ // AndroidX
222+ implementation(libs.appcompat)
223+ implementation(libs.core.ktx)
224+ implementation(libs.constraintlayout)
229225
230226 // Firebase
231- implementation(platform(" com.google. firebase:firebase- bom: $firebase_bom_version " ))
232- implementation(" com.google. firebase:firebase- analytics- ktx" )
233- implementation(" com.google. firebase:firebase- crashlytics- ktx" )
227+ implementation(platform(libs. firebase. bom))
228+ implementation(libs. firebase. analytics. ktx)
229+ implementation(libs. firebase. crashlytics. ktx)
234230
235231 // Dependency Injection
236- implementation(" com.google.dagger: hilt- android: $hilt_version " )
237- kapt(" com.google.dagger: hilt- compiler: $hilt_version " )
232+ implementation(libs. hilt. android)
233+ kapt(libs. hilt. compiler)
238234
239235 // Coroutines
240- implementation(" androidx .lifecycle:lifecycle- runtime-ktx:2.8.7 " )
241- implementation(" androidx .lifecycle:lifecycle- viewmodel-ktx:2.8.7 " )
242- implementation(" androidx .lifecycle:lifecycle-extensions:2.2.0 " )
243- implementation(" org.jetbrains.kotlinx:kotlinx- coroutines-core:1.7.3 " )
244- implementation(" org.jetbrains.kotlinx:kotlinx- coroutines-android:1.7.3 " )
236+ implementation(libs .lifecycle. runtime.ktx )
237+ implementation(libs .lifecycle. viewmodel.ktx )
238+ implementation(libs .lifecycle.extensions )
239+ implementation(libs. coroutines.core )
240+ implementation(libs. coroutines.android )
245241
246242 // Compose Bom
247- val composeBom = platform(" androidx .compose:compose-bom:2023.06.01 " )
243+ val composeBom = platform(libs .compose.bom )
248244 implementation(composeBom)
249- androidTestImplementation(composeBom)
250- implementation(" androidx.compose.foundation:foundation" )
251- implementation(" androidx.compose.material3:material3" )
245+ implementation(libs.compose.foundation)
246+ implementation(libs.compose.material3)
252247 // Compose - Android Studio Preview support
253- implementation(" androidx .compose.ui:ui- tooling- preview" )
254- debugImplementation(" androidx .compose.ui:ui- tooling" )
255- implementation(" androidx .activity:activity-compose:1.10.1 " )
248+ implementation(libs .compose.ui. tooling. preview)
249+ debugImplementation(libs .compose.ui. tooling)
250+ implementation(libs .activity.compose )
256251
257252 // Other UI Libraries
258- implementation(" com.google.android.material:material:$material_version " )
259-
260- // data
261- implementation(" androidx.datastore:datastore-preferences:1.1.4" )
262-
263- // unit test libs
264- testImplementation(" junit:junit:4.13.2" )
265-
266- // instrumented test libs
267- androidTestImplementation(" androidx.test:core:1.6.1" )
268- androidTestImplementation(" androidx.test.ext:junit:1.2.1" )
269- androidTestImplementation(" androidx.test.ext:junit-ktx:1.2.1" )
270- androidTestImplementation(" androidx.test.espresso:espresso-core:3.6.1" )
253+ implementation(libs.material)
271254
272- // Hamcrest for view matching
273- androidTestImplementation(" org.hamcrest:hamcrest-library:2.2" )
274- androidTestImplementation(" androidx.test:runner:1.6.2" )
275- androidTestImplementation(" androidx.test:rules:1.6.1" )
255+ // Data
256+ implementation(libs.datastore.preferences)
276257
277- // coroutine testing
278- testImplementation(" org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version " )
279- androidTestImplementation(" org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version " )
258+ // Unit Test Libraries
259+ testImplementation(libs.junit)
260+ testImplementation(libs.coroutines.test)
261+ testImplementation(libs.truth)
262+ testImplementation(libs.mockk.android)
263+ testImplementation(libs.mockk.agent)
280264
281- // google truth for assertions
282- testImplementation(" com.google.truth:truth:1.1.3" )
283- androidTestImplementation(" androidx.test.ext:truth:1.6.0" )
284-
285- // mockk
286- testImplementation(" io.mockk:mockk-android:$mockk_version " )
287- testImplementation(" io.mockk:mockk-agent:$mockk_version " )
288- androidTestImplementation(" io.mockk:mockk-android:$mockk_version " )
289- androidTestImplementation(" io.mockk:mockk-agent:$mockk_version " )
290-
291- // hilt testing - https://developer.android.com/training/dependency-injection/hilt-testing
292- androidTestImplementation(" com.google.dagger:hilt-android-testing:$hilt_version " )
293- kaptAndroidTest(" com.google.dagger:hilt-android-compiler:$hilt_version " )
265+ // Instrumented Test Libraries
266+ androidTestImplementation(composeBom)
267+ androidTestImplementation(libs.coroutines.test)
268+ androidTestImplementation(libs.androidx.test.core)
269+ androidTestImplementation(libs.androidx.test.ext.junit)
270+ androidTestImplementation(libs.androidx.test.ext.junit.ktx)
271+ androidTestImplementation(libs.espresso.core)
272+ androidTestImplementation(libs.hamcrest)
273+ androidTestImplementation(libs.androidx.test.runner)
274+ androidTestImplementation(libs.androidx.test.rules)
275+ androidTestImplementation(libs.androidx.test.truth)
276+ androidTestImplementation(libs.mockk.android)
277+ androidTestImplementation(libs.mockk.agent)
278+
279+ // Hilt Testing
280+ androidTestImplementation(libs.hilt.android.testing)
281+ kaptAndroidTest(libs.hilt.android.compiler)
294282
295283 // Android Serial Controller
296- implementation(" com.github.superus8r:UsbSerial:6.1.1 " )
284+ implementation(libs.usb.serial )
297285}
0 commit comments