Replace kapt by ksp

This commit is contained in:
Shinokuni 2024-07-06 14:01:58 +02:00
parent e6be6c36fe
commit 5bf974eb0c
3 changed files with 11 additions and 19 deletions

View File

@ -36,7 +36,7 @@ android {
} }
composeOptions { composeOptions {
kotlinCompilerExtensionVersion = "1.4.0" kotlinCompilerExtensionVersion = "1.5.3"
} }
lint { lint {

View File

@ -5,7 +5,7 @@ import com.android.build.gradle.LibraryPlugin
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
buildscript { buildscript {
val kotlin_version = "1.8.0" val kotlin_version = "1.9.10"
repositories { repositories {
google() google()
@ -19,6 +19,10 @@ buildscript {
} }
} }
plugins {
id("com.google.devtools.ksp") version "1.9.10-1.0.13" apply false
}
allprojects { allprojects {
//apply("jacoco") //apply("jacoco")

View File

@ -1,23 +1,14 @@
plugins { plugins {
id("com.android.library") id("com.android.library")
kotlin("android") kotlin("android")
kotlin("kapt")
kotlin("plugin.parcelize") kotlin("plugin.parcelize")
id("com.google.devtools.ksp")
} }
android { android {
namespace = "com.readrops.db" namespace = "com.readrops.db"
defaultConfig { defaultConfig {
javaCompileOptions {
annotationProcessorOptions {
arguments += mapOf(
"room.incremental" to "true",
"room.schemaLocation" to "$projectDir/schemas".toString()
)
}
}
consumerProguardFiles("consumer-rules.pro") consumerProguardFiles("consumer-rules.pro")
} }
@ -32,12 +23,9 @@ android {
} }
} }
// Needed for kapt starting with kotlin plugin 1.5 ksp {
kapt { arg("room.schemaLocation", "$projectDir/schemas")
arguments { arg("room.incremental", "true")
arg("room.schemaLocation", "$projectDir/schemas")
arg("room.incremental", "true")
}
} }
dependencies { dependencies {
@ -50,7 +38,7 @@ dependencies {
androidTestImplementation(libs.bundles.test) androidTestImplementation(libs.bundles.test)
implementation(libs.bundles.room) implementation(libs.bundles.room)
kapt(libs.room.compiler) ksp(libs.room.compiler)
androidTestImplementation(libs.room.testing) androidTestImplementation(libs.room.testing)
implementation(libs.bundles.paging) implementation(libs.bundles.paging)