https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
e

egorand

09/08/2019, 1:06 PM
My feeling is that custom source sets don’t really create separate compilation units under MPP, they just extend the default source sets but in the end get compiled into the same artifacts. Is this correct, or am I missing something?
d

Dominaezzz

09/08/2019, 1:55 PM
Yes, this is correct.
e

egorand

09/08/2019, 2:01 PM
Thanks! I’ll submit a feature request.
d

Dominaezzz

09/08/2019, 2:02 PM
I just reread, unless you explicitly depend on a source set from a compilation, it doesn't get compiled.
e

egorand

09/08/2019, 6:04 PM
In my experience, simply adding
dependsOn jvmMain
to a custom source set is not enough
The only thing that worked for me is having that source set
dependsOn commonMain
and then having
jvmMain { dependsOn customSourceSetMain }
h

h0tk3y

09/09/2019, 3:16 PM
@egorand take a look at having a custom compilation (
jvm { compilations { ... } }
), which actually is a separate compilation unit.
e

egorand

09/09/2019, 3:17 PM
Oh, interesting, thanks!
2 Views