Skip to content

Commit fbab551

Browse files
committed
Build: migrate Room to KSP
1 parent a8e518d commit fbab551

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

app/build.gradle.kts

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
alias(libs.plugins.android)
66
kotlin("android")
77
kotlin("kapt")
8+
alias(libs.plugins.ksp)
89
alias(libs.plugins.compose.compiler)
910
}
1011

@@ -163,10 +164,14 @@ android {
163164
kapt {
164165
arguments {
165166
arg("eventBusIndex", "com.battlelancer.seriesguide.SgEventBusIndex")
166-
arg("room.schemaLocation", "$projectDir/schemas")
167167
}
168168
}
169169

170+
ksp {
171+
arg("room.schemaLocation", "$projectDir/schemas")
172+
}
173+
174+
170175
dependencies {
171176
implementation(libs.kotlinx.coroutines.core)
172177
implementation(libs.kotlinx.coroutines.android)
@@ -218,7 +223,7 @@ dependencies {
218223
implementation(libs.androidx.room.ktx)
219224
// Paging 3 Integration
220225
implementation(libs.androidx.room.paging)
221-
kapt(libs.androidx.room.compiler)
226+
ksp(libs.androidx.room.compiler)
222227

223228
implementation(libs.dagger)
224229
kapt(libs.dagger.compiler)

billing/build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
alias(libs.plugins.android.library)
33
kotlin("android")
4-
kotlin("kapt")
4+
alias(libs.plugins.ksp)
55
}
66

77
val sgCompileSdk: Int by rootProject.extra
@@ -50,7 +50,7 @@ dependencies {
5050
implementation(libs.androidx.lifecycle.viewmodel)
5151
// Room
5252
implementation(libs.androidx.room.runtime)
53-
kapt(libs.androidx.room.compiler)
53+
ksp(libs.androidx.room.compiler)
5454

5555
implementation(libs.timber)
5656
}

build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
// app, libraries
55
alias(libs.plugins.android) apply false
66
alias(libs.plugins.kotlin) apply false
7+
alias(libs.plugins.ksp) apply false
78
alias(libs.plugins.compose.compiler) apply false
89
// Firebase Crashlytics
910
alias(libs.plugins.google.services) apply false

gradle/libs.versions.toml

+2
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ android-library = { id = "com.android.library" }
137137
# 2.1.0 is compatible with Gradle 7.6.3–8.10 and AGP 7.3.1–8.7.2
138138
kotlin = { id = "org.jetbrains.kotlin.android", version = "2.1.0" }
139139
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version = "2.1.0" }
140+
# https://github.com/google/ksp/releases
141+
ksp = { id = "com.google.devtools.ksp", version = "2.1.0-1.0.29" }
140142
# https://github.com/ben-manes/gradle-versions-plugin/releases
141143
versions = { id = "com.github.ben-manes.versions", version = "0.51.0" }
142144
# https://github.com/gradle-nexus/publish-plugin/releases

0 commit comments

Comments
 (0)