I have a task (lets call it firstTask
) which sets project.version
and another task (fourthTask
) which reads project.version
.
These tasks have a transitive mustRunAfter
dependency:
secondTask.mustRunAfter(firstTask)
thirdTask.mustRunAfter(secondTask)
fourthTask.mustRunAfter(thirdTask)
However, sometimes fourthTask does not see the version
change. In fact, it seems like it is run with a completely different project
object.
I’ve also tried to force task order using a BuildService
, and I’ve tried storing the version in this buildService, to no avail.
I can’t provide a build scan, as the issue goes away with --scan
. So I assume it has something to do with parallel execution, which is probably disabled for build scans.
How do I do this correctly? Where do I store a value which needs to be accessed from different tasks?