From 1b143d1c9776df305447ef762f9186c6c7777358 Mon Sep 17 00:00:00 2001 From: borednaeem Date: Tue, 7 Nov 2023 12:14:59 +0200 Subject: [PATCH] - add bundles section to version catalog [#918] --- app/build.gradle.kts | 45 ++++++++++----------------------------- gradle/libs.versions.toml | 18 +++++++++++++++- 2 files changed, 28 insertions(+), 35 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 51d6e0480..52eb058ae 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -111,53 +111,30 @@ androidComponents { dependencies { ksp(libs.androidx.room.compiler) ksp(libs.hilt.android.compiler) - implementation(libs.androidx.core.ktx) - implementation(libs.androidx.lifecycle.livedata.ktx) - implementation(libs.androidx.lifecycle.viewmodel.ktx) - implementation(libs.androidx.navigation.compose) - implementation(libs.androidx.paging.compose) - implementation(libs.androidx.room.ktx) - implementation(libs.androidx.work.runtime.ktx) + implementation(libs.bundles.retrofit) + implementation(libs.bundles.coroutines) + implementation(libs.bundles.hilt) + implementation(libs.bundles.androidx.impl) + implementation(libs.bundles.lifecycle) + implementation(libs.bundles.room) implementation(libs.material) implementation(libs.gson) implementation(libs.okhttp3.logging.interceptor) - implementation(libs.retrofit2.converter.gson) - implementation(libs.retrofit2) - implementation(libs.kotlinx.coroutines.android) - implementation(libs.kotlinx.coroutines.core) - implementation(libs.hilt.android) - implementation(libs.hilt.navigation.compose) - implementation(libs.androidx.profileinstaller) + implementation(libs.androidx.work.runtime.ktx) + implementation(libs.androidx.paging.compose) // Compose implementation(platform(libs.androidx.compose.bom)) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.constraintlayout.compose) - implementation(libs.androidx.compose.runtime) - implementation(libs.androidx.compose.ui) - implementation(libs.androidx.compose.foundation) - implementation(libs.androidx.compose.foundation.layout) - implementation(libs.androidx.compose.material3) - implementation(libs.androidx.compose.ui.viewbinding) - implementation(libs.androidx.compose.ui.tooling.preview) - implementation(libs.androidx.compose.runtime.livedata) - implementation(libs.androidx.lifecycle.viewmodel.compose) + implementation(libs.bundles.compose) implementation(libs.glide) - implementation(libs.accompanist.systemuicontroller) debugImplementation(libs.androidx.compose.ui.tooling) // Testing dependencies + androidTestImplementation(libs.bundles.espresso) + androidTestImplementation(libs.bundles.androidx.test) debugImplementation(libs.androidx.monitor) kspAndroidTest(libs.hilt.android.compiler) androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.androidx.arch.core.testing) - androidTestImplementation(libs.androidx.espresso.contrib) - androidTestImplementation(libs.androidx.espresso.core) - androidTestImplementation(libs.androidx.espresso.intents) - androidTestImplementation(libs.androidx.test.ext.junit) - androidTestImplementation(libs.androidx.test.uiautomator) - androidTestImplementation(libs.androidx.work.testing) - androidTestImplementation(libs.androidx.compose.ui.test.junit4) androidTestImplementation(libs.guava) androidTestImplementation(libs.hilt.android.testing) androidTestImplementation(libs.accessibility.test.framework) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d22e1646c..969748db3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -125,5 +125,21 @@ android-test = { id = "com.android.test", version.ref = "androidGradlePlugin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } -kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin"} +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } + +[bundles] +androidx-impl = ["androidx-core-ktx", "androidx-profileinstaller"] +coroutines = ["kotlinx-coroutines-android", "kotlinx-coroutines-core"] +hilt = ["hilt-android", "hilt-navigation-compose"] +room = ["androidx-room-ktx", "androidx-room-runtime"] +retrofit = ["retrofit2", "retrofit2-converter-gson"] +compose = ["androidx-compose-foundation", "androidx-compose-foundation-layout", "androidx-compose-material", + "androidx-compose-material3", "androidx-compose-runtime", "androidx-compose-runtime-livedata", + "androidx-compose-ui", "androidx-compose-ui-tooling-preview", + "androidx-compose-ui-viewbinding", "androidx-constraintlayout-compose", + "accompanist-systemuicontroller", "androidx-activity-compose", "androidx-navigation-compose"] +lifecycle = ["androidx-lifecycle-viewmodel-compose", "androidx-lifecycle-livedata-ktx", "androidx-lifecycle-viewmodel-ktx"] +espresso = ["androidx-espresso-contrib", "androidx-espresso-core", "androidx-espresso-intents"] +androidx-test = ["androidx-arch-core-testing", "androidx-test-ext-junit", "androidx-test-uiautomator", + "androidx-work-testing", "androidx-compose-ui-test-junit4"]