Upstream KSP implementation (#1393)

This commit is contained in:
Zac Sweers
2021-10-16 01:52:04 -04:00
committed by GitHub
parent de8bbf12f5
commit 2db351f8ed
25 changed files with 2164 additions and 131 deletions

View File

@@ -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)