11plugins {
2- id ' org.jetbrains.kotlin.plugin.serialization' version ' 2.2.10'
2+ id ' org.jetbrains.kotlin.plugin.serialization' version ' 2.2.20'
3+ id ' com.google.devtools.ksp'
34}
45
56if (imitate_isApp. toBoolean()) {
@@ -10,25 +11,6 @@ if (imitate_isApp.toBoolean()) {
1011
1112apply plugin : ' kotlin-android'
1213apply plugin : ' org.jetbrains.kotlin.plugin.compose'
13- apply plugin : ' kotlin-kapt'
14-
15- class RoomSchemaArgProvider implements CommandLineArgumentProvider {
16-
17- @InputDirectory
18- @PathSensitive (PathSensitivity .RELATIVE )
19- File schemaDir
20-
21- RoomSchemaArgProvider (File schemaDir ) {
22- this . schemaDir = schemaDir
23- }
24-
25- @Override
26- Iterable<String > asArguments () {
27- // Note: If you're using KSP, change the line below to return
28- // ["room.schemaLocation=${schemaDir.path}".toString()].
29- return [" -Aroom.schemaLocation=${ schemaDir.path} " . toString()]
30- }
31- }
3214
3315static def releaseTime () {
3416 return new Date (). format(" yyyyMMddHHmm" , TimeZone . getTimeZone(" GMT+8" ))
@@ -47,17 +29,6 @@ android {
4729
4830 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
4931
50- kapt {
51- arguments {
52- arg(" moduleName" , project. getName())
53- }
54- }
55- javaCompileOptions {
56- annotationProcessorOptions {
57- arguments = [AROUTER_MODULE_NAME : project. getName()]
58- compilerArgumentProviders(new RoomSchemaArgProvider (new File (projectDir, " schemas" )))
59- }
60- }
6132 // 只保留中文资源和 xxhdpi 分辨率图片
6233 resourceConfigurations + = [' zh-rCN' , ' xxhdpi' ]
6334
@@ -130,10 +101,9 @@ android {
130101 namespace ' com.engineer.imitate'
131102}
132103
133- kapt {
134- arguments {
135- arg(" moduleName" , project. getName())
136- }
104+ ksp {
105+ arg(" AROUTER_MODULE_NAME" , project. getName())
106+ arg(" room.schemaLocation" , new File (projectDir, " schemas" ). path)
137107}
138108
139109dependencies {
@@ -153,7 +123,7 @@ dependencies {
153123
154124
155125 implementation " com.alibaba:arouter-api:$ext . arouter_api "
156- kapt " com.alibaba:arouter-compiler:$ext . arouter_compiler "
126+ ksp " com.alibaba:arouter-compiler:$ext . arouter_compiler "
157127 implementation(' com.facebook.fresco:fresco:3.6.0' ) {
158128 exclude group : ' com.facebook.soloader' , module : ' soloader'
159129 exclude group : ' com.facebook.fresco' , module : ' soloader'
@@ -215,8 +185,7 @@ dependencies {
215185 // room
216186 implementation " androidx.room:room-runtime:$ext . roomVersion_runtime "
217187 implementation libs. androidx. room. rxjava2
218- // kapt 'org.xerial:sqlite-jdbc:3.36.0.3' // for mac m1
219- kapt " androidx.room:room-compiler:$ext . roomVersion "
188+ ksp " androidx.room:room-compiler:$ext . roomVersion "
220189
221190 implementation ' com.github.wanglu1209:PhotoViewer:0.50'
222191
@@ -225,16 +194,14 @@ dependencies {
225194 implementation ' com.geyifeng.immersionbar:immersionbar:3.2.2'
226195
227196 // from 2021
228- implementation ' com.beust:klaxon:5.6'
229- // implementation 'com.alibaba:fastjson:2.0.57'
230197 implementation ' com.alibaba:fastjson:1.1.71.android'
231198 implementation ' com.google.code.gson:gson:2.13.1'
232199 implementation libs. dagger
233- kapt libs. dagger. compiler
200+ ksp libs. dagger. compiler
234201
235202 implementation(" com.squareup.moshi:moshi:1.15.2" ) // 核心库
236203 implementation(" com.squareup.moshi:moshi-kotlin:1.15.2" ) // Kotlin 扩展(支持数据类)
237- kapt (" com.squareup.moshi:moshi-kotlin-codegen:1.15.2" ) // 代码生成(替代反射)
204+ ksp (" com.squareup.moshi:moshi-kotlin-codegen:1.15.2" ) // 代码生成(替代反射)
238205
239206 // coroutines
240207 // 👇 依赖协程核心库
0 commit comments