Is there no way to recover from a failed task? I would like to catch any failures in a task, recover by continuing on to the next task and dealing with it there. The task I’m looking at in particular is “build” and its dependencies.
I’ve tried looking at TaskState but that happens after the fact. Finalizer tasks only cleans up the task, and does not do much else. Prefer not to have to use the --continue argument.
I’ve personally also tried it with GradleBuild, but the GradleBuild task itself fails if any of the tasks it runs fails too (even with the --continue StartParameter).
As per our irc discussion, I’d like for this to be considered as a feature request / enhancement to TaskState =). This could theroetically be implemented by TaskState allowing us to manipulate the final TaskState when the task completes (either through the TaskExecutionListener, or Finalizer). A Finalizer task could allow for recovery from a task failure (like a try catch), without needing to make modifications to the task in question.
I’m not keen on this idea. It raises a lot of questions about how dependent tasks would deal with the fact that they can’t rely on their dependency successfully getting what they need in to the right state. That is, it’s somewhat against the dependency based model.
Also, we’d need one ore more compelling use cases in order to consider it.