Does anyone knows how to implement dependency on test target of shared module in KMM? For example. I have
shared
module and feature-modules.
shared
• androidMain
• commonMain
• commonTest
• iosMain
feature1
• commonMain
• commonTest
feature2
• commonMain
• commonTest
i want to use code from shared-commonTest in featureN-commonTest. When i implement shared module in feature module i haven’t this possibility even if i implement
shared
in featureN
commonTest
target
iamthevoid
04/27/2021, 1:38 PM
for example feature
kotlin
block
Copy code
kotlin {
android()
iOS()
sourceSets {
val commonMain by getting {
dependencies {
implementation(project(":lib:shared"))
...
}
}
val commonTest by getting {
dependencies {
implementation(project(":lib:shared"))
}
}
}
}
t
tapchicoma
04/27/2021, 2:27 PM
probably the best solution would be to move shared test code into separate multiplatform module
👍 1
c
corneil
04/27/2021, 4:34 PM
The test code doesn't end up in a library. You could try creating a jar with classifier test and use as a testImplementation dependency.