I wanted to start a new multi-platform project which will include, at first, a Ktor server and a JS webapp.
Most of the code can be in the common module, since the specifics will probably only be database engine, testing framework, ui-related classes and such.
For now, I only know of two actual modules: JVM (Or Native, not sure yet) and JS. But then I started to wonder: what if someone wants to create an iOS or Android version ?
My problem is, I don’t really want to put all that in one single repository. The ideal case would be to be able to define my common module as standalone, publish it on Bintray/whatever, and let people reference it as an
expectedBy() dependency so that they can benefit from the common code and only focus on their module, in whatever repo they want, without the need to give them access to my code or have them pull a whole bunch of seemingly unrelated stuff (i.e why would the Android app dev need to know about / have access to the Webapp implementation?)
I’ve been able to create a ‘standalone’ common project, which builds, but IntelliJ’s linter is not happy with my
expect declarations not having any
actual counterparts. Since my gradle build doesn’t know anything about the modules hosted in some other repo.
So the question is: is this possible? Am I simply doing something wrong, or is it plain impossible?
NB: I understand the concept of mpp when it comes to a project the team knows which actual platform-specific modules it wants to implement. Even for multi-platform libraries. Kotlin MPP works really well for that. My question is really how to benefit from Kotlin common, and share this common module so other, unrelated people, can create their own implementation without managing the rest?
This is what I get in IntelliJ for my common module:
Build is fine, but the linter, not so much ~