Piotr Krzemiński
10/20/2025, 5:54 PMimplementation kind of dependency, which was obviously a mistake. Then changed it to compileOnly, but now I'm getting:
> There was a failure while executing work items
> A failure occurred while executing kotlinx.benchmark.gradle.NativeSourceGeneratorWorker
> e: KLIB resolver: Could not find "it.krzeminski:copy-dsl-ksp-processor" in [/home/runner/work/snakeyaml-engine-kmp/snakeyaml-engine-kmp]
with this hint:
A compileOnly dependency is used in targets: Kotlin/JS, Kotlin/Native, Kotlin/Wasm.
Dependencies:
- snakeyaml-engine-kmp:copy-dsl-ksp-processor:unspecified (source sets: iosArm64Main, iosSimulatorArm64Main, iosX64Main, jsMain, linuxArm64Main, linuxX64Main, macosArm64Main, macosX64Main, mingwX64Main, tvosArm64Main, tvosSimulatorArm64Main, tvosX64Main, wasmJsMain, watchosArm32Main, watchosArm64Main, watchosSimulatorArm64Main, watchosX64Main)
Adding an api kind of dependency indeed helps, but only for another module in the repo that consumes my module using the KSP processor. For external clients, I'd still need to publish the lib.
My question is: how do I deal with using my local KSP processor only during build time, so that it doesn't need to be used in compile/runtime by the external clients?
Relevant PR: https://github.com/krzema12/snakeyaml-engine-kmp/pull/599Piotr Krzemiński
10/20/2025, 8:00 PMephemient
10/20/2025, 8:08 PMdependencies { implementation(project(":annotation")) } to reference it in a type-safe way, although KSP does let you look up annotations by name too
:lib can
dependencies {
implementation(project(":annotation")) // or compileOnly
ksp(project(":processor"))
}Piotr Krzemiński
10/20/2025, 8:20 PMephemient
10/20/2025, 8:23 PMPiotr Krzemiński
10/20/2025, 8:31 PMPiotr Krzemiński
10/20/2025, 8:33 PMephemient
10/20/2025, 8:34 PMPiotr Krzemiński
10/20/2025, 8:35 PMephemient
10/20/2025, 8:35 PMresolver.getSymbolsWithAnnotation("my.annotation")Piotr Krzemiński
10/20/2025, 8:36 PMephemient
10/20/2025, 8:37 PMPiotr Krzemiński
10/20/2025, 8:38 PMephemient
10/20/2025, 8:38 PMephemient
10/20/2025, 8:38 PMPiotr Krzemiński
10/20/2025, 8:38 PMThere was a failure while executing work items (...))ephemient
10/20/2025, 8:39 PMkotlinx.benchmark doing some additional magic and not the build itself… perhaps it has other issuesPiotr Krzemiński
10/20/2025, 8:41 PMPiotr Krzemiński
10/20/2025, 8:42 PMPiotr Krzemiński
10/20/2025, 8:42 PMephemient
10/20/2025, 8:43 PMPiotr Krzemiński
10/20/2025, 9:36 PM