Skip to content

Commit

Permalink
Migrate Room annotation processing to faster Kotlin-Symbol-Processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules Kerssemakers committed Feb 7, 2024
1 parent 7702c6c commit 7d060b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "kotlin-kapt"
id 'com.google.devtools.ksp'
id "com.mikepenz.aboutlibraries.plugin"
}

Expand All @@ -24,10 +24,8 @@ android {

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
}
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}
}

Expand Down Expand Up @@ -77,7 +75,7 @@ dependencies {
implementation "androidx.work:work-runtime-ktx:$workmanager_version"
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
ksp "androidx.room:room-compiler:$room_version"
implementation "com.mikepenz:aboutlibraries:$about_libraries_version"
implementation "androidx.core:core-splashscreen:1.0.1"

Expand Down
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ buildscript {
}
}

plugins {
// modern kotlin annotation support; replaces kapt: https://developer.android.com/build/migrate-to-ksp
id 'com.google.devtools.ksp' version '1.9.22-1.0.17' apply false
}

allprojects {
repositories {
google()
Expand Down

0 comments on commit 7d060b4

Please sign in to comment.