statmark56
09/29/2023, 12:46 PMtapchicoma
10/23/2023, 7:56 PMstatmark56
11/01/2023, 1:44 AM// build.gradle
dependencies {
kapt(libraryA)
}
When I run the unit test, I can see the kapt libraryA is running (main classpath) which I don't think it's necessary to run since my unit test simply doesn't need any of its generated codes.
My question is can I skip this particular kapt when running unit test? Currently I just apply the conditional check:
dependencies {
if (task is not unit test) {
kapt(libraryA)
}
}
It works but I'm just wondering for more cleaner way if any.tapchicoma
11/03/2023, 8:28 AMBrais Gabin
11/13/2023, 10:13 AMtasks
.matching {
it.name.startsWith("kapt") && it.name.endsWith("TestKotlin")
}
.configureEach { it.enabled = false }
from: https://www.zacsweers.dev/kapts-hidden-test-costs/ it only works if you don't want to run any annotation processor on your tests.