Is there any reason why the configuration cache ch...
# community-support
m
Is there any reason why the configuration cache changes the order in which tasks are executed? The example here involves the
com.avast.gradle.docker-compose
plugin (version
0.17.18
). With the configuration cache disabled, it runs, e.g., in this order:
:lib1:composeUp
,
:lib1:test
,
:lib1:composeDown
,
:lib2:composeUp
,
:liib2:test
,
:lib2:composeDown
. But with the configuration cache enabled, it looks like it runs
:lib1:composeUp
and
:lib2:composeUp
in parallel first. Which can cause issues if there are port conflicts between those two tasks. I've attached an MCVE.
v
One of the big benefits of the configuration cache is, that each and every task even within the same project can run in parallel unless they have some ordering constraint or dependency.
If tasks need to run in a given order, use
mustRunAfter
. If they just must not run in parallel, use a shared build service (implementation can be no-op) with a max-concurrency of 1 and configure all tasks that must not run in parallel with each other to use that shared build service, that way only one will run at a time.
1
j
That's an interesting way to use a shared build service. Huh.
v
That's one of its main intended use-cases actually afair. 😄 To represent a shared but limited resource.