diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 663ead9b..017a601a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,5 +1,3 @@ -@file:Suppress("UnstableApiUsage") - import org.jetbrains.kotlin.gradle.dsl.JvmTarget @@ -57,11 +55,11 @@ android { } buildTypes { - getByName("debug") { + debug { isMinifyEnabled = false } - getByName("release") { - isMinifyEnabled = false + release { + isMinifyEnabled = true } } } @@ -78,37 +76,51 @@ composeCompiler { } dependencies { - // Application dependencies + // Kotlin implementation(libs.kotlin.stdlib) implementation(libs.kotlinx.coroutines.core) implementation(libs.kotlinx.coroutines.android) - implementation(libs.koin.android) + + // Android implementation(libs.android.appcompat) + + // Koin + implementation(libs.koin.android) + implementation(libs.koin.androidx.compose.navigation) + + // Logging + implementation(libs.kermit) + implementation(libs.ktor.client.logging) + + // Networking & Image loading + implementation(libs.ktor.client.okhttp) + implementation(libs.coil.compose) + implementation(libs.coil.network.okhttp) + implementation(libs.ktor.client.content.negotiation) + implementation(libs.kotlinx.serialization.json) + implementation(libs.ktor.serialization.kotlinx.json) implementation(libs.converter.gson) - // Jetpack compose dependencies + // Compose // @see: https://developer.android.google.cn/develop/ui/compose/setup?hl=en#kotlin_1 - // Specify the Compose BOM with a version definition - val composeBom = platform("androidx.compose:compose-bom:2024.06.00") + val composeBom = platform("androidx.compose:compose-bom:2025.02.00") implementation(composeBom) - // Specify Compose library dependencies without a version definition - implementation("androidx.compose.foundation:foundation") - implementation("androidx.compose.material3:material3") - implementation("androidx.compose.material:material-icons-core") + implementation(libs.androidx.foundation) + implementation(libs.androidx.material3) + implementation(libs.androidx.material.icons.core) // Integration with activities - implementation("androidx.activity:activity-compose:1.9.0") + implementation(libs.androidx.activity.compose) // Integration with ViewModels - implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1") + implementation(libs.androidx.lifecycle.viewmodel.compose) // Integration with LiveData - implementation("androidx.compose.runtime:runtime-livedata") - // .. - // .. + implementation(libs.androidx.runtime.livedata) + implementation(libs.androidx.navigation.compose) // Android Studio Preview support - implementation("androidx.compose.ui:ui-tooling-preview") - debugImplementation("androidx.compose.ui:ui-tooling") + implementation(libs.androidx.ui.tooling.preview) + debugImplementation(libs.androidx.ui.tooling) // Unit/Integration tests dependencies testImplementation(composeBom) @@ -121,8 +133,8 @@ dependencies { // UI tests dependencies androidTestImplementation(composeBom) - androidTestImplementation("androidx.compose.ui:ui-test-junit4") - debugImplementation("androidx.compose.ui:ui-test-manifest") + androidTestImplementation(libs.androidx.ui.test.junit4) + debugImplementation(libs.androidx.ui.test.manifest) androidTestImplementation(libs.androidx.runner) androidTestImplementation(libs.androidx.espresso.core) androidTestImplementation(libs.androidx.junit) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e94bd956..352c31e8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,8 +1,8 @@ [versions] # sdk ----------- -compileSdk = "34" +compileSdk = "35" minSdk = "30" -targetSdk = "34" +targetSdk = "35" # kotlin --------- kotlin = "2.0.10" @@ -11,8 +11,15 @@ kotlinCoroutines = "1.7.3" # android -------- ksp = "2.0.10-1.0.24" appCompat = "1.7.0" +activityCompose = "1.10.1" +lifecycleViewmodelCompose = "2.8.7" koinAndroid = "3.5.6" converterGson = "2.9.0" +coil = "3.1.0" +kermit = "2.0.4" +kotlinxSerializationJson = "1.8.1" +ktor = "3.1.2" +navigationCompose = "2.8.9" # testing kotest = "5.6.2" @@ -28,7 +35,7 @@ rules = "1.6.1" leakcanaryAndroid = "2.14" # plugings ------- -androidGradlePlugin = "8.5.2" +androidGradlePlugin = "8.9.1" [libraries] @@ -39,11 +46,32 @@ kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-c # main module dependencies: android application related --- kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinCoroutines" } android-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appCompat" } -koin-android = { module = "io.insert-koin:koin-android", version.ref = "koinAndroid" } +androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" } +androidx-foundation = { module = "androidx.compose.foundation:foundation" } +androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycleViewmodelCompose" } +androidx-material-icons-core = { module = "androidx.compose.material:material-icons-core" } +androidx-material3 = { module = "androidx.compose.material3:material3" } +androidx-runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata" } +androidx-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" } +androidx-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" } +androidx-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } +androidx-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } +androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigationCompose" } converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "converterGson" } -# main module dependencies: android application related --- +koin-android = { module = "io.insert-koin:koin-android", version.ref = "koinAndroid" } +koin-androidx-compose-navigation = { module = "io.insert-koin:koin-androidx-compose-navigation", version.ref = "koinAndroid" } + +kermit = { module = "co.touchlab:kermit", version.ref = "kermit" } + +kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } +ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } +ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" } +ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" } +ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" } +coil-network-okhttp = { module = "io.coil-kt.coil3:coil-network-okhttp", version.ref = "coil" } +coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil" } # main module unit/integration test dependencies --- kotest-runner-junit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" } @@ -70,3 +98,4 @@ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } kotlin-ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 20db9ad5..4eaec467 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists