can I have multiple "common" folders? e.g. (common...
# multiplatform
w
can I have multiple "common" folders? e.g. (commonOneMain, commonTwoMain) I have two different js targets and I don't want to put in both all the commonMain code
s
I think "commonMain" is something special and hardcoded. For a similar need I just made separate Multiplatform projects / gradle modules.
w
thanks! I hope they'll add build variants one day 🙂
k
i think you can do two different jsOneMain and jsTwoMain and use them with common: kotlin { js(“jsOne”) { browser() } js(“jsTwo”) { nodejs() } }
g
Why having variants if you can have 2 modules instead? (curious about the use case)
w
no particular reasons, I just think build variants are easier to handle, maybe because I'm already used to them on android
g
I find them irritating when AS only refactor the current variant and you have to check X times with each variants just to ensure the renaming as been properly applied. I prefer modules that I can compose instead of variants.
w
ah yes, that's true.. still, it's 1 hour that I try to create a kmp project with two modules 😄 I've added module1 as a dependency of module2, but I cannot see the classes.. intellij suggests "add module1 to classpath", but it's already there :\
I figured it out, thanks! I'll look at using modules instead of build variants!
👍 1