Slackbot
06/16/2022, 8:22 AMThomas Broyer
06/16/2022, 8:29 AMBuildListener
but it's not compatible with configuration cache, so not future-proof: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:build_listeners)Big Chungus
06/16/2022, 4:03 PMBig Chungus
06/16/2022, 4:04 PMVampire
06/16/2022, 4:48 PMBuildEventsListenerRegistry
which should be a build-wide registry as far as I remember.
Once you add an operation completion listener to it, you should be fine.
Something like
abstract class TaskFailureHandler : BuildService<BuildServiceParameters.None>, OperationCompletionListener {
override fun onFinish(event: FinishEvent?) {
val result = (event as? TaskFinishEvent)?.result as? TaskFailureResult ?: return
result.failures.forEach {
println(it)
}
}
}
Vampire
06/16/2022, 4:53 PMBuildEventsListenerRegistry
also says
Allows a plugin to receive information about the operations that run within a build.
Big Chungus
06/16/2022, 6:13 PM