vincentm
02/09/2022, 9:33 AMandroidTest {
dependsOn(commonTest)
dependencies {
implementation("io.mockk:mockk:$mockkVersion") // <-- this dependency is also added to the `androidAndroidTest` source set
}
}
androidAndroidTest {
dependsOn(commonTest)
dependencies {
implementation("io.mockk:mockk-android:$mockkVersion")
}
}
For an unknown reason, my dep io.mockk:mockk
is also added to the androidAndroidTest
source set.vincentm
02/09/2022, 12:59 PM:shared:dependencies
and I look at debugAndroidTestRuntimeClasspath
I get:
+--- io.mockk:mockk-android:1.12.2
| +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10
| | \--- org.jetbrains:annotations:13.0
| +--- io.mockk:mockk:1.12.2
| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | +--- io.mockk:mockk-agent-jvm:1.12.2
| | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | | +--- org.jetbrains.kotlin:kotlin-reflect:1.3.72
| | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | | +--- io.mockk:mockk-agent-api:1.12.2
| | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | | +--- io.mockk:mockk-agent-common:1.12.2
| | | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | | | \--- io.mockk:mockk-agent-api:1.12.2 (*)
| | | +--- org.objenesis:objenesis:3.1
| | | +--- net.bytebuddy:byte-buddy:1.12.5
| | | \--- net.bytebuddy:byte-buddy-agent:1.12.5
| | +--- org.jetbrains.kotlin:kotlin-reflect:1.3.72 (*)
| | +--- io.mockk:mockk-common:1.12.2
| | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | | \--- io.mockk:mockk-dsl:1.12.2
| | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | \--- io.mockk:mockk-dsl-jvm:1.12.2
| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | +--- org.jetbrains.kotlin:kotlin-reflect:1.3.72 (*)
| | \--- io.mockk:mockk-dsl:1.12.2 (*)
| +--- io.mockk:mockk-agent-android:1.12.2
| | +--- io.mockk:mockk-agent-api:1.12.2 (*)
| | +--- io.mockk:mockk-agent-common:1.12.2 (*)
| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | +--- com.linkedin.dexmaker:dexmaker:2.28.1
| | | \--- com.jakewharton.android.repackaged:dalvik-dx:9.0.0_r3
| | +--- org.objenesis:objenesis:2.6 -> 3.1
| | \--- org.jetbrains.kotlin:kotlin-reflect:1.3.72 (*)
| \--- io.mockk:mockk-agent-api:1.12.2 (*)
vincentm
02/09/2022, 12:59 PMimplementation("io.mockk:mockk:$mockkVersion")
I get:
+--- io.mockk:mockk-android:1.12.2
| +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10
| | \--- org.jetbrains:annotations:13.0
| +--- io.mockk:mockk:1.12.2
| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | +--- org.jetbrains.kotlin:kotlin-reflect:1.3.72
| | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | +--- io.mockk:mockk-common:1.12.2
| | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | | \--- io.mockk:mockk-dsl:1.12.2
| | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | \--- io.mockk:mockk-dsl-jvm:1.12.2
| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | +--- org.jetbrains.kotlin:kotlin-reflect:1.3.72 (*)
| | \--- io.mockk:mockk-dsl:1.12.2 (*)
| +--- io.mockk:mockk-agent-android:1.12.2
| | +--- io.mockk:mockk-agent-api:1.12.2
| | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | +--- io.mockk:mockk-agent-common:1.12.2
| | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | | \--- io.mockk:mockk-agent-api:1.12.2 (*)
| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.6.10 (*)
| | +--- com.linkedin.dexmaker:dexmaker:2.28.1
| | | \--- com.jakewharton.android.repackaged:dalvik-dx:9.0.0_r3
| | +--- org.objenesis:objenesis:2.6
| | \--- org.jetbrains.kotlin:kotlin-reflect:1.3.72 (*)
| \--- io.mockk:mockk-agent-api:1.12.2 (*)
As you can see, io.mockk:mockk-agent-jvm
is added in the first case but not in the second case.vincentm
02/09/2022, 12:59 PMandroidAndroidTest
and androidTest
so androidTest
’s deps shouldn’t affect ``androidAndroidTest` ’s deps...
(Probably related to https://kotlinlang.slack.com/archives/C3PQML5NU/p1597873415394100)vincentm
02/09/2022, 3:50 PMandroidAndroidTest
inherit from a configuration named androidTestImplementation
. I think this conf should’t be associated to the androidAndroidTest
confs because this conf is already used by the androidTest
source set.vincentm
02/09/2022, 3:55 PMandroidTestImplementation
from the configurations dedicated to androidAndroidTest
. There is my code:
afterEvaluate {
configurations.findAll { it.name.contains("AndroidTestRuntimeClasspath") || it.name.contains("AndroidTestCompileClasspath") }.forEach {
it.setExtendsFrom(it.extendsFrom.findAll { it.name != "androidTestImplementation" })
}
}