is this how you use room compiler with ksp correct...
# multiplatform
j
is this how you use room compiler with ksp correctly. for some reason i was stuck with getting it work in kotlin multiplatforms dependency block and it dint work. But works in android dependencies block outside the kotlin block though.
Copy code
plugins {
    alias(libs.plugins.kotlin.multiplatform)
    alias(libs.plugins.google.ksp)
}
...
kotlin {
...
    sourceSets {
        commonMain.dependencies {
            ...
        }

        androidMain.dependencies {
// ksp reference is associated with gradle plugin extension        }
    }
}

android {
...
    dependencies {
        ksp(libs.room.compiler) // here room ksp compiler works
    }
}
Copy code
"ksp"(libs.room.compiler) or `add("ksp", libs.room.compiler)` doesnt either doesnt work either in androidMain.deps block.
j
Hi @Chrimaeon , Thanks. I have found the same reference from which I tried
add
method in deps block. Didnt work.
c
read it more carefully 😉 there is no
ksp
in multiplatform - each target has its own ksp configuration so for, depending on your target configuration, for android it is most probably
kspAndroidMain
👍 1
j
was bit confused because I was trying to use
add
method inside androidMain.dependencies block where
ksp
was inaccessible. now that i put a new dep block outside kotlin block it works. thanks.
this is not working btw
Configuration with name 'kspAndroidMain' not found.
. dropping this info so that it helps anyone looking for it.
j
Hi, I also find
kspAndroidMain
is not a valid name, only
kspAndroid
works. So there is no granularity of source sets (as documentation states), but only platforms?