Thread
#multiplatform
    h

    hmole

    4 years ago
    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
    ).
    russhwolf

    russhwolf

    4 years ago
    common-module1
    still needs platform modules even if they have no code.
    h

    hmole

    4 years ago
    How would that help? Do I need to import appropriate modules for each platform? So 'implementation "myLibrary"' in each platform module?
    russhwolf

    russhwolf

    4 years ago
    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

    hmole

    4 years ago
    Sound's like oversight on Jetbrains part. Creating empty modules instead of just importing in once through common module.
    russhwolf

    russhwolf

    4 years ago
    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

    hmole

    4 years ago
    So ho can my
    common-module2
    know about classes that are in 'common-modle1', if only my
    common-module2-jvm
    imports it?
    russhwolf

    russhwolf

    4 years ago
    common-module2
    should also have a dependency on
    common-module1
    .
    h

    hmole

    4 years ago
    But you just said common-modules don't know how to build a jar. What should I depend on then?
    russhwolf

    russhwolf

    4 years ago
    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