This message was deleted.
# community-support
s
This message was deleted.
v
No. Unless you then for example use Tooling API to kick off another build run with the determined tasks. But better find a more appropriate way to do what you try to do.
Or you could for example run all the tasks that might run and then use for example a build service to store the result of the first task and use
onlyIf { ... }
for all the other tasks to skip them if they are not part of the determined list.
👍 1
m
Got it, thanks for the advice!
👌 1
In a
BuildService
, how "long" do stored objects in memory live for? Do they persist across build invocations?
v
No, build service is scoped to one build invocation. Nothing should outlive a build invocation. Static state would, but that should be avoided as hell.
👍 1
m
So in order to ensure that task A (task that produces a list of tasks to run) executes and stores info in a BuildService before Task B runs, should I use a combination of
dependsOn
and
mustRunAfter
?
v
Usually any explicit
dependsOn
that does not have a lifecycle task on the left-hand side is a code smell, but in this specific case it might maybe be appropriate, yes. Combining with
mustRunAfter
is pointless though.
👍 1