https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

savrov

07/21/2020, 9:58 PM
Hello, Let’s say, I have a project with 2 modules: A & B. A module contains TestUtil class defined under
commonTest
. Is it possible to access to this class from *B*’s
commonTest
? I thought to do something like this, but it does not seems to work:
Copy code
commonMain {
 dependencies {
  implementation(project(':moduleA'))
 }
}
commonTest {
 dependencies {
  implementation(project(':moduleA'))
 }
}
r

russhwolf

07/21/2020, 10:26 PM
Test sources can’t depend on other module’s test sources. They can depend on main sources, though, so you could create module C, move
TestUtil
to its
commonMain
, and depend on C from A’s and B’s tests.
👌 1
s

savrov

07/21/2020, 10:38 PM
Got it. Thank you
2 Views