Skip to content

Commit

Permalink
Migrate from kapt to ksp
Browse files Browse the repository at this point in the history
  • Loading branch information
robinlinden committed Aug 30, 2023
1 parent ada0185 commit 35d9908
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
6 changes: 3 additions & 3 deletions atox/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.kotlinKapt)
alias(libs.plugins.kotlinKsp)
}

kotlin {
Expand Down Expand Up @@ -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)

Expand All @@ -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)
}
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
12 changes: 4 additions & 8 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
plugins {
alias(libs.plugins.androidLibrary)
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.kotlinKapt)
alias(libs.plugins.kotlinKsp)
}

kotlin {
Expand All @@ -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 {
Expand All @@ -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"))

Expand Down
1 change: 0 additions & 1 deletion domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
plugins {
alias(libs.plugins.androidLibrary)
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.kotlinKapt)
}

kotlin {
Expand Down
3 changes: 2 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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" }

Expand Down

0 comments on commit 35d9908

Please sign in to comment.