I have a type of tasks which are android connected tests. We want to run them in serial and not in parallel. I read this link: Ability to limit parallelism for tasks that require shared resources · Issue #7047 · gradle/gradle · GitHub
tasks.withType<com.android.build.gradle.internal.tasks.DeviceProviderInstrumentTestTask>()
There are a couple of ideas to do it:
-
Have a mutex. I feel that this is not a good solution as i don’t tell gradle explicitely all info it needs to so the performance will be suboptimal.
-
Use shared build service. I see examples on how to build a plugin with shared build services, but i have here already a set of tasks from android gradle plugin so i don’t understand how i can wire this together
So what should the code be here?
tasks.withType<com.android.build.gradle.internal.tasks.DeviceProviderInstrumentTestTask>() {
?
}