When adding a dependency to `commonMain` that does...
# multiplatform
m
When adding a dependency to
commonMain
that does not support a specific platform such as Kotlin/JS, how can I exclude the dependency from
jsMain
?
j
Add a nonJsMain source set, add it to all non-JS targets, and define it there?
m
Could you give an example for accomplishing that?
Or perhaps point me to some documentation? I haven't been able to find much on how the multiplatform configurations work for that kind of thing
j
I didn't add any dependencies, but you would just put them into the source set like any other
m
Awesome! Thanks. Do you have any insight on the conversion between the
sourceSetName { ... }
in Groovy to the Kotlin equivalent? Is that
val sourceSetName by creating { ... }
?
j
yes
or
create("sourceSetName") { }
to tone down their crazy DSL
m
Awesome I'll see if I can make this work for my project Thanks!
j
Had been meaning to do this as well for particular project....just tried it and works great! Thanks! https://github.com/joreilly/Confetti/pull/232/files#diff-cf9ae3b1eb7273a914f22b1e6d22d8447f88df0e7245a5b856fb751e507b979b
(in this case had dependency that was mobile specific that I didn't want pulled in for JVM)