This message was deleted.
# plugin-development
s
This message was deleted.
m
however there are a couple problems here:
1. there's not even a
BuildFinishedEvent
, so I'm not even talking about a
BuildSessionFinishedEvent
2. the docs are not super clear about the relationship between
OperationCompletionListener
and `BuildEventsListenerRegistry`: if I implement
OperationCompletionListener
, I have an
onEvent
method. Why would I care about a
BuildEventsListenerRegistry
? If I should care, how to use it?
I'm happy to investigate adding
BuildFinishedEvent
and
BuildSessionFinishedEvent
, but I'm extremely confused that at least the 1st one doesn't exist, since it's supposed to replace
buildFinished
. What am I missing?
p
Work is underway to add
BuildFinishedEvent
or some other form of listening/reacting to the build result. The configuration cache team is working on that. I don't think they have plans for something like
BuildSessionFinishedEvent
.
👍 1
cc @Rodrigo Oliveira, @Mikhail Lopatkin, @adam
m
Thanks Paul! Would be nice to consider this.For context, I need something like that for my Micronaut Test Resources plugin. A test resources server is spawned during the build, but it must outlive a single build, and only be shutdown at the end of the build session. Currently it's done in an extremely dirty way: https://github.com/micronaut-projects/micronaut-gradle-plugin/blob/5379f28ecac1b2aad105db3f587bc502c9823d10/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/MicronautTestResourcesPlugin.java#L292-L321
v
1. there's not even a
BuildFinishedEvent
, so I'm not even talking about a
BuildSessionFinishedEvent
You currently can only receive task finish events. To do something additionally at the end of the build, you would implement
AutoCloseable
and do the action there.
the docs are not super clear about the relationship between
OperationCompletionListener
and `BuildEventsListenerRegistry`: if I implement
OperationCompletionListener
, I have an
onEvent
method. Why would I care about a
BuildEventsListenerRegistry
? If I should care, how to use it?
You get the
BuildEventsListenerRegistry
to register your
OperationCompletionListener
. Just that it implements the interface does not mean it get any events. Only if you registered the listener you start receiving events.
👍 1
m
Thanks for the clarification on the listener registry API. Unfortunately, using
AutoCloseable
won't work for me: I need to make a difference between end of the current build and end of the build session. Since build services are bound to a single build, I'm out of luck (I already created a ticket for this).
v
Yep, we talked about that in the past. 🙂