Refactor: Update dependencies and Gradle configuration

This commit updates various dependencies and reconfigures Gradle settings to newer versions and standards.

Specific changes include:

-   Updated Android Gradle Plugin to 8.6.1
-   Updated Kotlin to 2.1.20
-   Updated Compose Compiler to 1.5.15
-   Updated Compose BOM to 2025.04.01
-   Updated Hilt to 2.54
-   Updated KSP to 2.1.20-2.0.0
-   Updated other dependencies like Navigation, Core-Ktx, Lifecycle, Activity Compose, Room, Paging, Coil, Serialization Json
-   Migrated to Java 21
-   Applied Compose plugin
- Updated target and compile SDK to 35
- updated jvm target to Java 21
This commit is contained in:
2025-04-28 13:43:58 +02:00
parent d6a3ee2a1c
commit 1849f72cb6
13 changed files with 118 additions and 48 deletions

View File

@ -21,13 +21,15 @@ plugins {
group = "dev.adriankuta.convention.buildlogic"
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
dependencies {
compileOnly(libs.android.tools.build.gradle.plugin)
compileOnly(libs.kotlin.gradle.plugin)
compileOnly(libs.android.gradlePlugin)
compileOnly(libs.compose.gradlePlugin)
compileOnly(libs.kotlin.gradlePlugin)
compileOnly(libs.ksp.gradlePlugin)
}
gradlePlugin {

View File

@ -7,6 +7,7 @@ import org.gradle.kotlin.dsl.getByType
class ComposeConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
val extension = extensions.getByType<BaseExtension>()
configureCompose(extension)
}

View File

@ -6,7 +6,7 @@ import org.gradle.api.JavaVersion
@Suppress("UnstableApiUsage")
internal fun configureAndroid(commonExtension: CommonExtension<*, *, *, *, *>) {
commonExtension.apply {
compileSdk = 34
compileSdk = 35
defaultConfig {
minSdk = 24
@ -19,8 +19,8 @@ internal fun configureAndroid(commonExtension: CommonExtension<*, *, *, *, *>) {
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
packaging {
resources {

View File

@ -4,8 +4,12 @@ import com.android.build.gradle.BaseExtension
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalog
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.assign
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
import kotlin.with
@Suppress("UnstableApiUsage")
internal fun Project.configureCompose(commonExtension: BaseExtension) {
@ -14,8 +18,15 @@ internal fun Project.configureCompose(commonExtension: BaseExtension) {
compose = true
}
with(pluginManager) {
apply("org.jetbrains.kotlin.plugin.compose")
}
val libs: VersionCatalog = extensions.getByType<VersionCatalogsExtension>().named("libs")
/*extensions.configure<ComposeCompilerGradlePluginExtension> {
}*/
composeOptions {
kotlinCompilerExtensionVersion =
libs.findVersion("composeCompiler").get().toString()