I have a big kotlin project, with a module that ha...
# javascript
n
I have a big kotlin project, with a module that has only dataclasses, this module I want to use for both my other kotlin modules, and my javascript module, but I cannot apply both the kotlin plugin and the kotlin2js plugin at the same time, and a simple "compile (':project')" dependency just leads to resolution failure in gradle. How do I go about having a shared module between my kotlin server and my kotlinjs frontend?
n
ok, so the kotlin-platform-common plugin is only available from 1.2 and forward? I do not need any different implementations, only a common module
k
So you'll get three modules, one with common code and two platform-specific without code at all
n
yea, but can I do this in 1.1 in any way? Or do I have to wait for 1.2?
k
You don't have to wait for 1.2. You can get 1.2-Beta
n
yea but I'd rather not put that in production 😉
k
How far is your application from production? Are you going to finish it in couple days?
n
hopefully 😄
just hard to know whether 1.2 is 1 week out or a couple of months from our perspective, so we'd rather not put a hard dependency on it
k
I think you can. 1.2-Beta is stable and reliable enough
Anyway, you don't have alternatives
n
ok, thank you 🙂
u
With gradle you can create two modules sharing the same source set. You will get issues in idea though
g
We are currently doing that - we have common classes in the JS module and then we include them in the serverside sourceset
works for us, though on one machine IDEA isn't happy with our shannenigans 😄 (works OK on the rest)