@@ -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
6769kotlin {
70+ jvmToolchain(appConfig.jvmToolChain)
6871 compilerOptions {
6972 jvmTarget.set(appConfig.jvmTarget)
7073 }
7174}
7275
76+ composeCompiler {
77+ enableStrongSkippingMode = true
78+ }
79+
7380dependencies {
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)
0 commit comments