mirror of
https://github.com/fankes/moshi.git
synced 2025-10-20 08:29:22 +08:00
Upstream KSP implementation (#1393)
This commit is contained in:
@@ -18,7 +18,15 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
kotlin("kapt")
|
||||
kotlin("kapt") apply false
|
||||
alias(libs.plugins.ksp) apply false
|
||||
}
|
||||
|
||||
val useKsp = hasProperty("useKsp")
|
||||
if (useKsp) {
|
||||
apply(plugin = "com.google.devtools.ksp")
|
||||
} else {
|
||||
apply(plugin = "org.jetbrains.kotlin.kapt")
|
||||
}
|
||||
|
||||
tasks.withType<Test>().configureEach {
|
||||
@@ -37,9 +45,14 @@ tasks.withType<KotlinCompile>().configureEach {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
kaptTest(project(":kotlin:codegen"))
|
||||
if (useKsp) {
|
||||
"kspTest"(project(":kotlin:codegen"))
|
||||
} else {
|
||||
"kaptTest"(project(":kotlin:codegen"))
|
||||
}
|
||||
testImplementation(project(":moshi"))
|
||||
testImplementation(project(":kotlin:reflect"))
|
||||
testImplementation(project(":kotlin:tests:extra-moshi-test-module"))
|
||||
testImplementation(kotlin("reflect"))
|
||||
testImplementation(libs.junit)
|
||||
testImplementation(libs.assertj)
|
||||
|
Reference in New Issue
Block a user