Skip to content

Commit

Permalink
Manually compare by name when checking if a task should be enabled
Browse files Browse the repository at this point in the history
This is a workaround for #1522
  • Loading branch information
PaulWoitaschek committed Sep 5, 2023
1 parent bdf4d3c commit 7f28c3f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import org.jetbrains.kotlin.gradle.dsl.*
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilationInfo
import org.jetbrains.kotlin.gradle.plugin.SubpluginOption
import org.jetbrains.kotlin.gradle.plugin.mpp.enabledOnCurrentHost
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompileTool
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Expand All @@ -59,6 +58,7 @@ import org.jetbrains.kotlin.gradle.tasks.configuration.BaseKotlin2JsCompileConfi
import org.jetbrains.kotlin.gradle.tasks.configuration.KotlinCompileCommonConfig
import org.jetbrains.kotlin.gradle.tasks.configuration.KotlinCompileConfig
import org.jetbrains.kotlin.incremental.ChangedFiles
import org.jetbrains.kotlin.konan.target.HostManager
import java.io.File
import java.nio.file.Paths
import javax.inject.Inject
Expand Down Expand Up @@ -155,7 +155,11 @@ class KotlinFactories {
)

kspTask.onlyIf {
kspTask.konanTarget.enabledOnCurrentHost
// kspTask.konanTarget.enabledOnCurrentHost
// workaround for: https://github.com/google/ksp/issues/1522
HostManager().enabled.any {
it.name == kspTask.konanTarget.name
}
}
}
}
Expand Down

0 comments on commit 7f28c3f

Please sign in to comment.