Skip to content

Commit

Permalink
Dependencies upgrade. Migrated to Kotlin 2.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriy-chernysh committed Oct 9, 2024
1 parent f5f22ef commit b1db258
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
[![CodeFactor](https://www.codefactor.io/repository/github/mobiledevpro/jetpack-compose-chatapp-template/badge)](https://www.codefactor.io/repository/github/mobiledevpro/jetpack-compose-chatapp-template)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=mobiledevpro_Jetpack-Compose-ChatApp-Template&metric=alert_status)](https://sonarcloud.io/dashboard?id=mobiledevpro_Jetpack-Compose-ChatApp-Template)

[![Kotlin Version](https://img.shields.io/badge/Kotlin-1.9.23-blue.svg?style=flat-square)](http://kotlinlang.org/)
[![Compose Bom](https://img.shields.io/badge/Compose%20Bom-2024.04.01-blue.svg?style=flat-square)]([http://kotlinlang.org/](https://developer.android.com/jetpack/compose/bom/bom-mapping))
[![Gradle](https://img.shields.io/badge/Gradle-8.2.0-blue.svg?style=flat-square)](https://developer.android.com/build/releases/gradle-plugin)
[![Kotlin Version](https://img.shields.io/badge/Kotlin-2.0.20-blue.svg?style=flat-square)](http://kotlinlang.org/)
[![Compose Bom](https://img.shields.io/badge/Compose%20Bom-2024.09.03-blue.svg?style=flat-square)]([http://kotlinlang.org/](https://developer.android.com/jetpack/compose/bom/bom-mapping))
[![Gradle](https://img.shields.io/badge/Gradle-8.7.0-blue.svg?style=flat-square)](https://developer.android.com/build/releases/gradle-plugin)
[![API](https://img.shields.io/badge/Min%20SDK-24%20[Android%207.0]-blue.svg?style=flat-square)](https://github.com/AndroidSDKSources/android-sdk-sources-list)
[![Target SDK](https://img.shields.io/badge/Target%20SDK-34%20[Android%2014]-blue.svg?style=flat-square)](https://developer.android.com/about/versions/13)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](http://www.apache.org/licenses/LICENSE-2.0)
[![Android Studio](https://img.shields.io/badge/Android%20Studio%20Jellyfish-2023.3.1-orange.svg?style=flat-square)](https://developer.android.com/studio/preview)
[![Android Studio](https://img.shields.io/badge/Android%20Studio%20Ladybug-2024.2.1-orange.svg?style=flat-square)](https://developer.android.com/studio/preview)

![GitHub last commit](https://img.shields.io/github/last-commit/mobiledevpro/Jetpack-Compose-ChatApp-Template?color=red&style=flat-square)
##
Expand Down
11 changes: 6 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
id("com.android.application")
kotlin("android")
kotlin("kapt")
alias(libs.plugins.compose.compiler)

alias(libs.plugins.google.services)
alias(libs.plugins.crashlytics)
Expand Down Expand Up @@ -83,6 +84,8 @@ android {
}

compileOptions {
android.compileOptions.isCoreLibraryDesugaringEnabled = true

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
Expand All @@ -94,9 +97,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}

packaging {
resources.excludes.add("/META-INF/{AL2.0,LGPL2.1}")
Expand Down Expand Up @@ -146,15 +146,16 @@ tasks.register("renameBundle") {
println("Version name: ${variant.versionName}")
println("Version code: ${variant.versionCode}")
println("Flavor name: ${variant.productFlavors.map { it.name }.joinToString()}")

println("Build directory: ${layout.buildDirectory.get()}")

val flavorName = variant.productFlavors.map { it.name }.joinToString()
val variantName = variant.name
val buildType = variant.buildType.name
val versionName = variant.versionName
val versionCode = variant.versionCode

val bundleDir =
"$buildDir/outputs/bundle/${variantName}"
"${layout.buildDirectory.get()}/outputs/bundle/${variantName}"

val oldFileName = "app-${flavorName}-${buildType}.aab"
val newFileName =
Expand Down
8 changes: 4 additions & 4 deletions build-logic/src/main/kotlin/core-compose-module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ plugins {
id("core-module")
}

with(pluginManager) {
apply("org.jetbrains.kotlin.plugin.compose")
}

android {
buildFeatures.compose = true

composeOptions {
kotlinCompilerExtensionVersion = libs.versionStr("compose.compiler")
}
}

dependencies {
Expand Down
8 changes: 4 additions & 4 deletions build-logic/src/main/kotlin/feature-module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ plugins {
id("core-module")
}

with(pluginManager) {
apply("org.jetbrains.kotlin.plugin.compose")
}

android {
buildFeatures.compose = true

composeOptions {
kotlinCompilerExtensionVersion = libs.versionStr("compose.compiler")
}
}

dependencies {
Expand Down
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.kapt) apply false
alias(libs.plugins.compose.compiler) apply false
}

tasks.register("clean", Delete::class){
delete(rootProject.buildDir)
delete(layout.buildDirectory.get())
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.NavigationBar
import androidx.compose.material3.NavigationBarItem
import androidx.compose.material3.NavigationBarItemDefaults
import androidx.compose.material3.surfaceColorAtElevation
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
Expand All @@ -42,7 +43,7 @@ fun AppBottomBar(
NavigationBar(
modifier = modifier,
contentColor = MaterialTheme.colorScheme.onSurfaceVariant,
tonalElevation = 4.dp,
containerColor = MaterialTheme.colorScheme.surfaceColorAtElevation(4.dp),
content = content
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.surfaceColorAtElevation
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -39,13 +40,14 @@ import androidx.compose.ui.unit.dp
@Composable
fun CardItem(modifier: Modifier, content: @Composable ColumnScope.() -> Unit) {
Card(
modifier = modifier
modifier = Modifier
.padding(start = 16.dp, end = 16.dp, top = 8.dp, bottom = 8.dp)
.fillMaxWidth()
.wrapContentHeight(align = Alignment.Top),
.wrapContentHeight(align = Alignment.Top)
.then(modifier),
elevation = CardDefaults.cardElevation(2.dp),
colors = CardDefaults.cardColors(
containerColor = MaterialTheme.colorScheme.surface
containerColor = MaterialTheme.colorScheme.surfaceColorAtElevation(2.dp)
),
content = content
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.mobiledevpro.domain.model.PeopleProfile
import com.mobiledevpro.domain.model.fakePeopleProfileList
import com.mobiledevpro.ui.component.CardItem
import com.mobiledevpro.ui.component.ProfileContent
import com.mobiledevpro.ui.component.ProfilePicture
import com.mobiledevpro.ui.component.ProfilePictureSize
import com.mobiledevpro.ui.theme.AppTheme

/**
* For People list
Expand All @@ -41,13 +44,10 @@ import com.mobiledevpro.ui.component.ProfilePictureSize
*/
@Composable
internal fun ProfileCard(modifier: Modifier = Modifier, item: PeopleProfile, onClick: () -> Unit) {
CardItem(
modifier = modifier
.clickable { onClick.invoke() }
) {

CardItem(modifier = modifier.clickable { onClick.invoke() }) {
Row(
modifier = Modifier.fillMaxWidth(),
modifier = Modifier
.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Start
) {
Expand All @@ -66,4 +66,15 @@ internal fun ProfileCard(modifier: Modifier = Modifier, item: PeopleProfile, onC
)
}
}
}

@Composable
@Preview
internal fun ProfileCardPreview() {
AppTheme {
ProfileCard(
item = fakePeopleProfileList[0],
onClick = {}
)
}
}
61 changes: 28 additions & 33 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,49 @@ sdk-target = "34"
sdk-compile = "34"

# Plugins
android-gradle = "8.1.4"
kotlin = "1.9.23"
kotlin-coroutines = "1.8.0"
android-gradle = "8.7.0"
kotlin = "2.0.20"
kotlin-coroutines = "1.9.0"
kotlin-serialization = "1.4.1"
google-services = "4.4.1"
plugin-crashlytics = "2.9.9"
google-services = "4.4.2"
plugin-crashlytics = "3.0.2"
plugin-performance = "1.4.2"

# Libs
android-core-ktx = "1.12.0"
activity = "1.8.2"
navigation = "2.8.0-alpha07"
android-core-ktx = "1.13.1"
activity = "1.9.2"
navigation = "2.8.2"
retrofit = "2.9.0"
room = "2.4.3"
lifecycle = "2.7.0"
compose-bom = "2024.04.01"
compose-compiler = "1.5.11"
compose-alpha = "1.7.0-alpha07"

coil = "2.5.0"
material3 = "1.2.1"
koin = "3.5.3"
data-store = "1.0.0"
koin-compose = "3.5.3"
coroutines-android = "1.8.0"
workmanager = "2.9.0"
lifecycle = "2.8.6"
compose-bom = "2024.09.03"

coil = "2.6.0"
material3 = "1.3.0"
koin = "4.0.0"
data-store = "1.1.1"
koin-compose = "3.5.6"
coroutines-android = "1.9.0"
workmanager = "2.9.1"
inapp-update = "2.1.0"
splash-screen = "1.1.0-rc01"

# Firebase
firebase-bom = "32.8.1"
firebase-bom = "33.4.0"

# test libraries
test-junit = "4.13.2"
test-mockk = "1.13.10"
test-mockk = "1.13.13"
test-coroutines-flow = "1.1.0"

# android test libraries
test-android-runner = "1.5.2"
junit = "1.1.5"
espresso-core = "3.5.1"
test-android-runner = "1.6.2"
junit = "1.2.1"
espresso-core = "3.6.1"

# 3rd party libs
lottie = "6.1.0"
desugaring = "2.0.4"
appcompat = "1.6.1"
material = "1.11.0"
desugaring = "2.1.2"

[plugins]

Expand All @@ -65,6 +61,7 @@ kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref =
google-services = { id = "com.google.gms.google-services", version.ref = "google-services" }
crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "plugin-crashlytics" }
performance-monitor = { id = "com.google.firebase.firebase-perf", version.ref = "plugin-performance" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } # Compose Compiler plugin was added in Kotlin 2.0

[libraries]

Expand All @@ -76,7 +73,6 @@ lyfecycle-runtime = { group = "androidx.lifecycle", name = "lifecycle-runtime-kt
lyfecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "lifecycle" }
navigation = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation" }
coil = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" }
kotlin-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlin-coroutines" }
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
gradle = { module = "com.android.tools.build:gradle", version.ref = "android-gradle" }
gradle-api = { module = "com.android.tools.build:gradle-api", version.ref = "android-gradle" }
Expand All @@ -91,14 +87,13 @@ splash-screen = { module = "androidx.core:core-splashscreen", version.ref = "spl
# Compose
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
compose-ui = { group = "androidx.compose.ui", name = "ui" }
compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics", version.ref = "compose-alpha" }
compose-ui-animation = { group = "androidx.compose.animation", name = "animation", version.ref = "compose-alpha" }
compose-ui-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview", version.ref = "compose-alpha" }
compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
compose-ui-animation = { group = "androidx.compose.animation", name = "animation" }
compose-ui-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
compose-ui-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" }
compose-ui-util = { group = "androidx.compose.ui", name = "ui-util" }
#compose-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout-compose", version.ref = "constraintlayout" }

# test libraries
test-junit = { module = "junit:junit", version.ref = "test-junit" }
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Feb 24 16:13:44 EET 2023
#Wed Oct 09 17:02:37 UTC 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit b1db258

Please sign in to comment.