Colton Idle
01/17/2024, 4:35 PMandroidTestImplementation
compile in a compose multiplatform project?jw
01/17/2024, 4:36 PMjw
01/17/2024, 4:37 PMimplementation
dependencyColton Idle
01/17/2024, 4:48 PMandroidNativeTest.dependencies {
implementation("androidx.compose.ui:ui-test-junit4")
}
ephemient
01/17/2024, 4:58 PMjw
01/17/2024, 4:59 PMJeff Lockhart
01/17/2024, 5:16 PMandroidInstrumentedTest
that you want. Note that by default, this source set is not connected to the commonTest
source set tree, so it won't run common code. If you want it to be, then you can specify the source set tree like this:
kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
androidTarget {
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
unitTestVariant.sourceSetTree.set(KotlinSourceSetTree.unitTest)
}
}
This connects the androidInstrumentedTest
source set to the commonTest
tree, and disconnects the androidUnitTest
source set from it, assuming you want to run your common tests as instrumented tests and not unit tests.Colton Idle
01/17/2024, 6:19 PMproductFlavors {
create("free") {
dimension = "stage"
applicationIdSuffix = ".free"
}
create("paid") { dimension = "stage" }
}
then in kotlin {}
i have
sourceSets {
sourceSets.invokeWhenCreated("androidFree") {
}
sourceSets.invokeWhenCreated("androidPaid") {
}
I updated my dirs from /free and /paid to androidFree and androidPaid.
does that all seem correct?