How to properly declare a dependency on pure(no pl...
# multiplatform
h
How to properly declare a dependency on pure(no platform modules)
common-module1
jar in another
common-module2
? So far i'm getting NoClassDefFound in my 'common-module2-jvm', but IDE doesn't highlight imports as red and allows to navigate to them(
common-module1
).
r
common-module1
still needs platform modules even if they have no code.
1
h
How would that help? Do I need to import appropriate modules for each platform? So 'implementation "myLibrary"' in each platform module?
r
Yeah. so
common-module1-jvm
has an
expectedBy common-module1
and then
common-module2-jvm
has both
expectedBy common-module2
and
implementation common-module1-jvm
h
Sound's like oversight on Jetbrains part. Creating empty modules instead of just importing in once through common module.
r
The common module doesn’t know to build a Jar. The jvm module is there so it knows that’s what you want to do. Though someone from Jetbrains can speak better than I can to the design decisions around that.
h
So ho can my
common-module2
know about classes that are in 'common-modle1', if only my
common-module2-jvm
imports it?
r
common-module2
should also have a dependency on
common-module1
.
h
But you just said common-modules don't know how to build a jar. What should I depend on then?
r
You end up with a sort of doubled-up dependency tree. So
common-module2-jvm
depends on both
common-module1-jvm
and
common-module2
, and both of those have a dependency on
common-module1