I have a multiplatform project, and I'm having som...
# multiplatform
l
I have a multiplatform project, and I'm having some dependency problems. Here's the issue: I have the largest multiplatform module, called
array
. (JVM, native and JS). I then have another module called
ffi
(JVM and Linux).
ffi
depends on
array
. Now, the
commonTest
sourceset in
array
contains some helper classes that are useful for tests in the
ffi
module as well, so I tried to add a dependency from
commonTest
in
ffi
to
array
, but that doesn't allow me to see the helper classes in the other module. My workaround is this: I crated a new module, called
test-tools
and placed the helper classes in its
commonMain
.
test-tools
then depends on
array
(because it needs to access some classes there). And then (and this is the weird part), I have the
commonTest
in
array
depend on
test-tools
. Does this this create a circular dependency? test-tools/commonMain depends on array, and array/commonTest depends on test-tools. It does seem to work, assuming that a dependency is always to the
main
rather than
test
. However, I would much prefer to depend on array/commonTest directly, is that possible? Or is my workaround the correct way?
without that, the separate module is fine. it does not introduce a circular dependency
l
@ephemient thanks a lot for your clarification.