i have a `jvmMain` and an `androidMain` source fol...
# multiplatform
r
i have a
jvmMain
and an
androidMain
source folder in my shared module. It seems like l have to duplicate the actual class declaration in both jvmMain and androidMain as if I just have the jvm version the expected class says something like "there isnt an actual declaration for jvm" (referring to androidMain). If i delete my android source set and gradle declaration the shared library complains about a missing
AndroidManifest.xml
. So just wondering if it is normal that i would have to duplicate
androidMain
and
jvmMain
s
Maybe try making androidMain depend on jvmMain
r
I ont guess you have any tips on how to do it for kts? For gradle i do
Copy code
sourceSets {
test {
    java.srcDir 'src/sharedTest/java'
}
}
but there seems to be no srcDir function for kts
s
dependsOn(jvmMain)
in the
androidMain
is how you normally make dependent sourcesets.
✔️ 1
r
yes that works a treat .. thanks 🙂
s
Did it solve the expect/actual issue you were facing?
j
another approach if you dont want to share all jvm, is having a folder called something like androidAndJvm and add it to both sourcesets (you can see this approach in compose-jb samples)
r
@Sourabh Rawat yes it worked thanks
@Javier thanks good to know ... actually all my classes are the same atm but that would be better