From afc442a0e4464cabfc9bcfe5de9ea0f31eb03565 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Mon, 20 Nov 2023 14:26:56 -0500 Subject: [PATCH] Don't configure KspTask in KotlinCompile tasks Similar to stub gen, we don't actually want to configure these even though they extend kotlincompile because KSP applies their own mappings --- slack-plugin/src/main/kotlin/slack/gradle/util/kgpUtil.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/slack-plugin/src/main/kotlin/slack/gradle/util/kgpUtil.kt b/slack-plugin/src/main/kotlin/slack/gradle/util/kgpUtil.kt index 0a4cb7ceb..d1e9b3b4d 100644 --- a/slack-plugin/src/main/kotlin/slack/gradle/util/kgpUtil.kt +++ b/slack-plugin/src/main/kotlin/slack/gradle/util/kgpUtil.kt @@ -15,6 +15,7 @@ */ package slack.gradle.util +import com.google.devtools.ksp.gradle.KspTask import org.gradle.api.tasks.TaskContainer import org.jetbrains.kotlin.gradle.internal.KaptGenerateStubsTask import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask @@ -31,6 +32,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile */ internal fun TaskContainer.configureKotlinCompilationTask( includeKaptGenerateStubsTask: Boolean = false, + includeKspTask: Boolean = false, action: KotlinCompilationTask<*>.() -> Unit ) { withType(KotlinCompilationTask::class.java) @@ -38,5 +40,6 @@ internal fun TaskContainer.configureKotlinCompilationTask( // standard kotlin compilation, which can lead to duplicates. SOOOO we skip configuration of // it here. Callers to this _can_ opt in to including it, but they must be explicit. .matching { includeKaptGenerateStubsTask || it !is KaptGenerateStubsTask } + .matching { includeKspTask || it !is KspTask } .configureEach { action() } }