From ada01852fdcbd82dc0ea915cba0d8c1020da9985 Mon Sep 17 00:00:00 2001 From: Robin Linden Date: Wed, 30 Aug 2023 22:10:13 +0200 Subject: [PATCH 1/2] Update Dagger --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d3a24968..ee9d949a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ kotlin = "1.9.10" android-plugin = "7.4.2" coroutines = "1.7.3" -dagger = "2.47" +dagger = "2.48" espresso = "3.5.1" jackson = "2.15.2" lifecycle = "2.5.1" # 2.6.1 From 35d9908594cd95a3d4080880fcaaf43a584ce1c8 Mon Sep 17 00:00:00 2001 From: Robin Linden Date: Wed, 30 Aug 2023 22:23:20 +0200 Subject: [PATCH 2/2] Migrate from kapt to ksp --- atox/build.gradle.kts | 6 +++--- build.gradle.kts | 1 - core/build.gradle.kts | 12 ++++-------- domain/build.gradle.kts | 1 - gradle/libs.versions.toml | 3 ++- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/atox/build.gradle.kts b/atox/build.gradle.kts index 413ff0aa..81ec82c4 100644 --- a/atox/build.gradle.kts +++ b/atox/build.gradle.kts @@ -2,7 +2,7 @@ plugins { alias(libs.plugins.androidApplication) alias(libs.plugins.kotlinAndroid) - alias(libs.plugins.kotlinKapt) + alias(libs.plugins.kotlinKsp) } kotlin { @@ -85,7 +85,7 @@ dependencies { implementation(libs.androidx.lifecycle.viewmodel.ktx) implementation(libs.google.dagger.core) - kapt(libs.google.dagger.compiler) + ksp(libs.google.dagger.compiler) implementation(libs.androidx.multidex) @@ -101,5 +101,5 @@ dependencies { androidTestImplementation(libs.test.espresso.core) androidTestImplementation(libs.test.espresso.contrib) androidTestImplementation(libs.test.junit.ext) - kaptAndroidTest(libs.google.dagger.compiler) + kspAndroidTest(libs.google.dagger.compiler) } diff --git a/build.gradle.kts b/build.gradle.kts index 96453221..055d799f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,7 +2,6 @@ plugins { alias(libs.plugins.versions) alias(libs.plugins.kotlinAndroid) apply false - alias(libs.plugins.kotlinKapt) apply false alias(libs.plugins.androidLibrary) apply false alias(libs.plugins.androidApplication) apply false } diff --git a/core/build.gradle.kts b/core/build.gradle.kts index c93a2279..546413f0 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -2,7 +2,7 @@ plugins { alias(libs.plugins.androidLibrary) alias(libs.plugins.kotlinAndroid) - alias(libs.plugins.kotlinKapt) + alias(libs.plugins.kotlinKsp) } kotlin { @@ -15,12 +15,8 @@ android { defaultConfig { minSdk = libs.versions.sdk.min.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - javaCompileOptions { - annotationProcessorOptions { - arguments.putAll( - mapOf("room.schemaLocation" to "$projectDir/schemas"), - ) - } + ksp { + arg("room.schemaLocation", "$projectDir/schemas") } } buildTypes { @@ -43,7 +39,7 @@ dependencies { api(libs.kotlinx.coroutines.core) api(libs.androidx.room.runtime) api(libs.androidx.room.ktx) - kapt(libs.androidx.room.compiler) + ksp(libs.androidx.room.compiler) testImplementation(kotlin("test")) diff --git a/domain/build.gradle.kts b/domain/build.gradle.kts index 2aa17be5..7bc0fead 100644 --- a/domain/build.gradle.kts +++ b/domain/build.gradle.kts @@ -2,7 +2,6 @@ plugins { alias(libs.plugins.androidLibrary) alias(libs.plugins.kotlinAndroid) - alias(libs.plugins.kotlinKapt) } kotlin { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ee9d949a..78dde351 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,6 +3,7 @@ sdk-min = "19" sdk-target = "31" kotlin = "1.9.10" +ksp = "1.9.10-1.0.13" android-plugin = "7.4.2" coroutines = "1.7.3" @@ -18,7 +19,7 @@ tox4j-core = "0.2.3" [plugins] versions = "com.github.ben-manes.versions:0.47.0" kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } -kotlinKapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } +kotlinKsp = { id = "com.google.devtools.ksp", version.ref = "ksp" } androidApplication = { id = "com.android.application", version.ref = "android-plugin" } androidLibrary = { id = "com.android.library", version.ref = "android-plugin" }