google / ksp

Kotlin Symbol Processing API
https://github.com/google/ksp
Apache License 2.0
2.72k stars 254 forks source link

Generate KSP Dependency Classes for iOSMain Module inside a Kotlin Multiplatform project #1974

Open TheArchitect123 opened 1 week ago

TheArchitect123 commented 1 week ago

I'm currently building a Kotlin Multiplatform project. Is there any way currently to generate classes with KSP into the iOSMain folder, instead of specific target folders?

I'm currently using Koin with KSP to generate a dependency graph for my project. It works fine for Android, however since the modules are generated at the architecture target folders, there's no way to run initialisation at the iOSMain, without having to write this on Swift.

 with("io.insert-koin:koin-ksp-compiler:1.3.0") {
        add("kspCommonMainMetadata", this)
        add("kspAndroid", this)
        add("kspIosArm64", this)
        add("kspIosSimulatorArm64", this)
        add("kspIosX64", this)
    }

I found a similar issue here https://github.com/google/ksp/issues/929

Does anyone know a workaround for this? It's been over 2 years now and Google still hasn't provided a solution.