Hi, why the ksp generates files into `android/andr...
# ksp
r
Hi, why the ksp generates files into
android/androidDebug
? Where I can specify it? I would need it in
commonMain
t
It might be a bug. Are you using 1.9.0-1.0.12? If so, could you try to see if it happens with 1.9.0-1.0.11?
r
I'm on '1.8.21-1.0.11' atm, will try 1.9. thx for response
I've updated to
1.9.0
and it's still the same (project). Is it caused by that the
Processor
is in
jvm
module? I've tried to move it to common source set, but the dep
com.google.devtools.ksp:symbol-processing-api
is only for
jvm
😞 or should I use
com.google.devtools.ksp:symbol-processing-cmdline
for common source set? I was following the kmp example but its not for ios
the problem is that when I build it for ios it will be also generated in
iosSimulatorArm64
and it will trigger redeclaration error. I need it only for common sourceSet
t
KSP follows Kotlin compilation model that common sources are included and compiled / processed together with target sources. They are not libraries. For example, if you specify
kspIosSimulatorArm64
and
kspCommonMainMetadata
, common sources will be processed twice, one in common and one in (ios siumulator + common). Therefore, this line introduces some duplicated, generated code. With current KMP compilation model, you can simply rely on the fact that common sources are processed along with target sources. Although common sources sometimes do get processed individually, they are rarely needed unless you are publishing libraries.
btw, processors themselves don't need to be compiled to multiplatform. After all, they only run at compile time in Gradle, which is JVM only.