This message was deleted.
# community-support
s
This message was deleted.
j
org.gradle.parallel
lets tasks run in parallel, so if you have multiple test tasks in the same project, yes they can run in parallel
j
Is there a way to enable this property for all subprojects except this one?
j
you could use
mustRunAfter
to force the tasks to run in serial. but this would not be ideal
j
Indeed, that's why I was hoping for something more natural. I guess that's close enough to what I want to express, though. So maybe I should go this route
j
Change that property in the gradle.properties of that subproject, it should have priority over the root gradle.properties
v
There's a bit of desinformation in here.
org.gradle.parallel
lets task run in parallel, but only if those tasks are in different projects. Tasks within a project are afair only run in paralllel if you either use the configuration cache, or if the task submitted work items using the worker api and there are tasks not depending on that task those could also run in parallel.
To prevent task from running in parallel, register a shared build service with max concurrent use set to 1 and declare all those tasks as using that build service, then they will not run in parallel.
👍 1
This is the proper abstraction for your case.
j
Oooo TIL thanks
v
And @Javi a thing like a subproject
gradle.properties
does not even exist unless you use a plugin that adds it. And even then it would not work for a build-wide setting like
org.gradle.parallel
.
j
Are you sure? when I have tried, if a
gradle.properties
is near to the project, it has preference, so: 1. project/gradle.properties 2. gradle.properties 3. user home .gradle/gradle.properties
v
Yes I am, unless something changed I'm not aware of and that also the documentation is not aware of which confirms what I say
If
project/gradle.properties
is considered, then most probably by some plugin you are using and then
org.gradle.parallel
would not have any effect.
👍 1
Wouldn't make much sense anyway as it is just about running projects in parallel and has no meaning for a project in isolation
j
Oh ok so I had understood correctly
org.gradle.parallel
. The shared build service is actually exactly what I need I believe. I'm currently using the avast docker compose plugin to launch the test server, and AFAIR they were mentioning migrating to a build service: https://github.com/avast/gradle-docker-compose-plugin/issues/307#issuecomment-1023357193 Not sure how it ended being implemented but maybe I could configure concurrency directly there then. Thanks a lot @Vampire
👌 1