When working with KSP on KMP, I’ve seen a couple d...
# multiplatform
d
When working with KSP on KMP, I’ve seen a couple different approaches for applying the room compiler for the different targets
Copy code
dependencies {
    add("kspAndroid", libs.androidx.room.compiler)
    add("kspIosSimulatorArm64", libs.androidx.room.compiler)
    add("kspIosX64", libs.androidx.room.compiler)
    add("kspIosArm64", libs.androidx.room.compiler)
}
I’ve also seen
Copy code
dependencies {
    add("kspCommonMainMetadata", libs.androidx.room.compiler)
}
Which is the more correct way to apply a plugin using ksp? I’ve seen the first approach on the Fruitties app’s build.gradle.kts file, is this the preferred method? I’m wondering because if I use the second approach, the project still builds, compiles and on top of that I don’t have issues with the
instantiateImpl
being unresolved in my
iosMain
directory. Any guidance/opinions would be appreciated here, thanks!
c
Great question, we've just been using the former as per the example