A platform module can only import one common modul...
# multiplatform
k
A platform module can only import one common module. <Issue resolved> Thanks 🙂
i
common modules can only depend on other common modules and platform module can depend on common with expectedBy dependency.
k
But you can only have one
expectedBy
import. I thought it was just for the Expect/Actual set up. Also importing multiple common modules the normal way seems to be working
i
Each common module should have corresponding platform module, which declares expectedBy dependency on it. Currently it is 1-to-1 relationship (but for each platform)
k
Can a platform module import multiple common modules (all without any expect/actual classes) just fine?
Alright I think I finally get what you were saying. So a platform module can only import one common module and it can only import it via expectBy
So can you not chain multiple common modules together? It does not look like you can.
Ok known limitation for now. Good to know @ilya.gorbunov Thank you
i
You can chain common modules together, but each common module must have a platform implementation module (even if there are no
expect
declarations), and platform modules must be chained respectively
k
When I do Core (imports nothing) Shared (imports Core) App (imports Shared) I get an error saying Shared is missing the Core’s classes
If this is a bug. I can look into it further and open a ticket?
i
You need to create Core-JVM for Core and add a dependency in App on Core-JVM
k
Shared has the Core dependencies? Isn’t that the same thing?
Or are you saying something like Core (imports nothing, common) Shared (imports Core, contains expect class, common) AppDependency(imports Core and Shared, JVM) App (expectBy AppDependency, contains actual class, JVM)
i
say you have
A:common
,
B:common (depends on A:common)
then you need to have
A:platform expectedBy A:common
,
B:platform expectedBy B:common
and
B:platform depends on A:platform
k
Oh
So every common module would need a “mock” platform module if theres no expectBy
Thanks for making this clear
i
Starting from 1.2.40 it will be possible not to have A:platform, and declare both expectedBy dependencies in B:platform
k
Awesome thanks for letting me know. So far the multiplatform set up is pretty neat. My company is building our web app with it. Thank you for your help