I’m working on a project where we support JVM, Linux, macOS and Windows platform.
The structure is:
common module with almost all code
JVM module with JVM implementation of expected classes/funs
native module called native with almost all expected code except for some IO
linux/macos module called posix with the implementation of IO; depends on native module
mingw module called mingw with the implementation of IO; depends on native module
The project is structured as describe above because there are some small differences between linux/macos and Windows. Just one class. The rest of the native code is the same.
Everything builds just fine and works as expected.
However, the native module is not recognized as a native one and IntelliJ thus report unresolved references.
I can, of course, add something like
linuxX64("native") to markt he project as native one but it won’t compile as the native module doesn’t implement expected class for IO.
If I add dummy implementation, the compilation fails because there are more than one implementation for expected class.
I would somehow need to mark the native module as being native but not containing the complete implementation.
I can use
@Suppress("NO_ACTUAL_FOR_EXPECT") to suppress the error, but that’s a bit dangerous.