Skip to content

Commit 85ff6d9

Browse files
committed
chore: add needed jetpack compose dependencies
1 parent 3ae544d commit 85ff6d9

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

app/build.gradle.kts

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class AppConfig {
1313
val targetSdk = libs.versions.targetSdk.get().toInt()
1414

1515
val jvmTarget = JvmTarget.JVM_17
16+
val jvmToolChain = 17
1617
val javaVersion = JavaVersion.VERSION_17
1718
val testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1819
}
@@ -52,6 +53,7 @@ android {
5253
// @see: https://developer.android.com/develop/ui/compose/tooling#bom
5354
// @see: https://developer.android.com/develop/ui/compose/bom
5455
compose = true
56+
buildConfig = true
5557
}
5658

5759
buildTypes {
@@ -65,11 +67,16 @@ android {
6567
}
6668

6769
kotlin {
70+
jvmToolchain(appConfig.jvmToolChain)
6871
compilerOptions {
6972
jvmTarget.set(appConfig.jvmTarget)
7073
}
7174
}
7275

76+
composeCompiler {
77+
enableStrongSkippingMode = true
78+
}
79+
7380
dependencies {
7481
// Application dependencies
7582
implementation(libs.kotlin.stdlib)
@@ -79,10 +86,32 @@ dependencies {
7986
implementation(libs.android.appcompat)
8087
implementation(libs.converter.gson)
8188

82-
// jetpack compose dependencies
83-
// https://developer.android.google.cn/develop/ui/compose/setup?hl=en#kotlin_1
89+
// Jetpack compose dependencies
90+
// @see: https://developer.android.google.cn/develop/ui/compose/setup?hl=en#kotlin_1
91+
// Specify the Compose BOM with a version definition
92+
val composeBom = platform("androidx.compose:compose-bom:2024.06.00")
93+
implementation(composeBom)
94+
95+
96+
// Specify Compose library dependencies without a version definition
97+
implementation("androidx.compose.foundation:foundation")
98+
implementation("androidx.compose.material3:material3")
99+
implementation("androidx.compose.material:material-icons-core")
100+
// Integration with activities
101+
implementation("androidx.activity:activity-compose:1.9.0")
102+
// Integration with ViewModels
103+
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1")
104+
// Integration with LiveData
105+
implementation("androidx.compose.runtime:runtime-livedata")
106+
// ..
107+
// ..
108+
109+
// Android Studio Preview support
110+
implementation("androidx.compose.ui:ui-tooling-preview")
111+
debugImplementation("androidx.compose.ui:ui-tooling")
84112

85113
// Unit/Integration tests dependencies
114+
testImplementation(composeBom)
86115
testImplementation(libs.kotest.runner.junit5)
87116
testImplementation(libs.kotest.assertions.core)
88117
testImplementation(libs.kotest.property)
@@ -91,6 +120,9 @@ dependencies {
91120
testImplementation(libs.robolectric)
92121

93122
// UI tests dependencies
123+
androidTestImplementation(composeBom)
124+
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
125+
debugImplementation("androidx.compose.ui:ui-test-manifest")
94126
androidTestImplementation(libs.androidx.runner)
95127
androidTestImplementation(libs.androidx.espresso.core)
96128
androidTestImplementation(libs.androidx.junit)

gradle/libs.versions.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ androidGradlePlugin = "8.5.2"
3636
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
3737
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinCoroutines" }
3838

39-
# main module dependencies: android related ---
39+
# main module dependencies: android application related ---
4040
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinCoroutines" }
4141
android-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appCompat" }
4242
koin-android = { module = "io.insert-koin:koin-android", version.ref = "koinAndroid" }
4343
converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "converterGson" }
4444

45+
# main module dependencies: android application related ---
46+
47+
4548
# main module unit/integration test dependencies ---
4649
kotest-runner-junit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" }
4750
kotest-assertions-core = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }

0 commit comments

Comments
 (0)