mirror of
https://github.com/f-droid/fdroidclient.git
synced 2025-12-23 23:27:44 -05:00
Migrate from KAPT to KSP
This commit is contained in:
@@ -6,6 +6,7 @@ buildscript {
|
||||
}
|
||||
plugins {
|
||||
alias libs.plugins.android.application apply false
|
||||
alias libs.plugins.android.ksp apply false
|
||||
alias libs.plugins.jetbrains.kotlin.android apply false
|
||||
alias libs.plugins.jetbrains.kotlin.multiplatform apply false
|
||||
alias libs.plugins.jetbrains.kotlin.plugin.serialization apply false
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
compileSdk = "35"
|
||||
kotlin = "2.0.20"
|
||||
androidGradlePlugin = "8.6.1"
|
||||
androidKspPlugin = "2.0.20-1.0.25" # first version needs to match kotlin version
|
||||
dokka = "1.9.20"
|
||||
mavenPublish = "0.18.0"
|
||||
jlleitschuhKtlint = "12.1.1"
|
||||
@@ -159,6 +160,7 @@ json = { module = "org.json:json", version.ref = "json" }
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
|
||||
android-ksp = { id = "com.google.devtools.ksp", version.ref = "androidKspPlugin" }
|
||||
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||||
jetbrains-kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
||||
jetbrains-kotlin-plugin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
||||
|
||||
@@ -6741,6 +6741,11 @@
|
||||
<sha256 value="f1dd23f8ae34a8e91366723991ead0d6499d1a3e9163ce550c200b02d76a872b" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.devtools.ksp" name="symbol-processing" version="2.0.20-1.0.25">
|
||||
<artifact name="symbol-processing-2.0.20-1.0.25.jar">
|
||||
<sha256 value="e71741ea913426a52532721991bda4a918a189b37256957331dc30fcf2dbeb11" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.devtools.ksp" name="symbol-processing-api" version="1.6.10-1.0.2">
|
||||
<artifact name="symbol-processing-api-1.6.10-1.0.2.jar">
|
||||
<pgp value="24D04176586361FDA94EE0315F7786DF73E61F56"/>
|
||||
@@ -6763,6 +6768,21 @@
|
||||
<sha256 value="76b7d149b26c014b47f8b408ec8a18a59c79ccbb85bea0e60b5e49585250f140" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.devtools.ksp" name="symbol-processing-api" version="2.0.20-1.0.25">
|
||||
<artifact name="symbol-processing-api-2.0.20-1.0.25.jar">
|
||||
<sha256 value="bdd3a3e76ee21c958e0f2a62d717cc61665e6f5a0b141eff00e056eb9f58d8fe" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.devtools.ksp" name="symbol-processing-common-deps" version="2.0.20-1.0.25">
|
||||
<artifact name="symbol-processing-common-deps-2.0.20-1.0.25.jar">
|
||||
<sha256 value="6c2972d213dabb64ba8dd8c14711c9034c13aa3cecf58f5ec8a8dce34bd4a4f0" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.devtools.ksp" name="symbol-processing-gradle-plugin" version="2.0.20-1.0.25">
|
||||
<artifact name="symbol-processing-gradle-plugin-2.0.20-1.0.25.jar">
|
||||
<sha256 value="4ce1fc1b6ea08c4eadc630768d608a624f556d65b056bea0f7b9789018105a41" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.errorprone" name="error_prone_annotation" version="2.19.1">
|
||||
<artifact name="error_prone_annotation-2.19.1.jar">
|
||||
<sha256 value="38c45cdaf993a7df6697703ca6ee00acbe376d3dade8d44daac3e33f039ca516" origin="Generated by Gradle"/>
|
||||
@@ -13126,6 +13146,11 @@
|
||||
<sha256 value="6abe146c27864138b874ccccfe5f534e3eb923c99a1b7b5d45494ee5694f3e0a" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.jetbrains.kotlin" name="kotlin-stdlib" version="1.9.23">
|
||||
<artifact name="kotlin-stdlib-1.9.23.jar">
|
||||
<sha256 value="8910cc238807d86ef550cb1f0b10dd5ed40b35a4ec1a52525f760aede84ead37" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.jetbrains.kotlin" name="kotlin-stdlib" version="1.9.24">
|
||||
<artifact name="kotlin-stdlib-1.9.24.jar">
|
||||
<sha256 value="858b902696da9cf585ab9d98ffc1c2712269828354dfe9107e3711b084a36468" origin="Generated by Gradle"/>
|
||||
@@ -14244,6 +14269,11 @@
|
||||
<sha256 value="a4053a35abeb59bf707d7948245556fe8dc379e9cfed088aec08134c899605d4" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.jetbrains.kotlinx" name="kotlinx-serialization-core-jvm" version="1.6.3">
|
||||
<artifact name="kotlinx-serialization-core-jvm-1.6.3.jar">
|
||||
<sha256 value="29c821a8d4e25cbfe4f2ce96cdd4526f61f8f4e69a135f9612a34a81d93b65f1" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.jetbrains.kotlinx" name="kotlinx-serialization-core-linuxx64" version="1.3.0">
|
||||
<artifact name="kotlinx-serialization-core.klib">
|
||||
<sha256 value="ad49d11305253b69fdfab52bb88b2181701916871442081010c82950650021ad" origin="Generated by Gradle because artifact wasn't signed"/>
|
||||
@@ -14322,6 +14352,11 @@
|
||||
<sha256 value="6fc10b056e1006963abb2b9fc393dcd4e38425358b6f16285e8f63d3429ffd21" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.jetbrains.kotlinx" name="kotlinx-serialization-json-jvm" version="1.6.3">
|
||||
<artifact name="kotlinx-serialization-json-jvm-1.6.3.jar">
|
||||
<sha256 value="d3234179bcff1886d53d67c11eca47f7f3cf7b63c349d16965f6db51b7f3dd9a" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.jetbrains.kotlinx" name="kotlinx-serialization-json-linuxx64" version="1.3.2">
|
||||
<artifact name="kotlinx-serialization-json.klib">
|
||||
<sha256 value="2a83e997494070d01e91d9d5d356f26cb1b2ba703fd063d7eee4ad60b9fe328c" origin="Generated by Gradle because artifact wasn't signed"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id 'kotlin-android'
|
||||
id 'com.android.library'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.google.devtools.ksp'
|
||||
id 'org.jetbrains.dokka'
|
||||
id 'com.vanniktech.maven.publish'
|
||||
}
|
||||
@@ -15,11 +15,6 @@ android {
|
||||
targetSdk 34 // relevant for instrumentation tests (targetSdk 21 fails on Android 14)
|
||||
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
|
||||
}
|
||||
}
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
testInstrumentationRunnerArguments disableAnalytics: 'true'
|
||||
}
|
||||
@@ -56,9 +51,6 @@ android {
|
||||
freeCompilerArgs += "-Xexplicit-api=strict"
|
||||
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
|
||||
}
|
||||
kapt {
|
||||
correctErrorTypes true
|
||||
}
|
||||
aaptOptions {
|
||||
// needed only for instrumentation tests: assets.openFd()
|
||||
noCompress "json"
|
||||
@@ -80,7 +72,7 @@ dependencies {
|
||||
|
||||
implementation libs.androidx.room.runtime
|
||||
implementation libs.androidx.room.ktx
|
||||
kapt libs.androidx.room.compiler
|
||||
ksp libs.androidx.room.compiler
|
||||
|
||||
implementation libs.microutils.kotlin.logging
|
||||
implementation libs.kotlinx.serialization.json
|
||||
@@ -110,8 +102,8 @@ dependencies {
|
||||
androidTestImplementation libs.commons.io
|
||||
}
|
||||
|
||||
plugins.withId("kotlin-kapt") {
|
||||
kapt.useBuildCache = true
|
||||
ksp {
|
||||
arg(new RoomSchemaArgProvider(new File(projectDir, "schemas")))
|
||||
}
|
||||
|
||||
signing {
|
||||
@@ -127,3 +119,18 @@ tasks.withType(DokkaTask).configureEach {
|
||||
}"""]
|
||||
)
|
||||
}
|
||||
|
||||
class RoomSchemaArgProvider implements CommandLineArgumentProvider {
|
||||
@InputDirectory
|
||||
@PathSensitive(PathSensitivity.RELATIVE)
|
||||
File schemaDir
|
||||
|
||||
RoomSchemaArgProvider(File schemaDir) {
|
||||
this.schemaDir = schemaDir
|
||||
}
|
||||
|
||||
@Override
|
||||
Iterable<String> asArguments() {
|
||||
return ["room.schemaLocation=${schemaDir.path}".toString()]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,21 @@ internal abstract class FDroidDatabaseInt : RoomDatabase(), FDroidDatabase, Clos
|
||||
getRepositoryDao().resetETags()
|
||||
}
|
||||
}
|
||||
|
||||
// just here to make KSP happy
|
||||
override fun close() {
|
||||
super.close()
|
||||
}
|
||||
|
||||
// just here to make KSP happy
|
||||
override fun runInTransaction(body: Runnable) {
|
||||
super.runInTransaction(body)
|
||||
}
|
||||
|
||||
// just here to make KSP happy
|
||||
override fun <V> runInTransaction(body: Callable<V>): V {
|
||||
return super.runInTransaction(body)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user