IsaevMH
(Isaev Maxim)
August 30, 2022, 12:29pm
1
Hi there.
I noticed one issue after updating Gradle. I got the next warning:
‘buildFinished(org.gradle.api.Action<? super org.gradle.BuildResult>)’ is deprecated
Unfortunately, I couldn’t find a similar method.
Can you tell me if one of these exists?
Best regards.
Chris_Dore
(Chris Doré)
September 7, 2022, 5:52am
2
It appears there’s no complete solution for this yet, but here’s some more details.
opened 06:51AM - 11 Mar 22 UTC
a:regression
@configuration-cache
Starting in Gradle 7.4, both the `Gradle.buildFinished` and `BuildListener.build… Finished` are deprecated. Apparently, it was not possible to get these methods to work with the configuration caching feature. The deprecation message does not list an alternative mechanism for being called when a build completes. In addition to this deprecation breaking one of my plugins, it seems like a serious regression to remove the ability to receive such a fundamental event as the completion of the build. Perhaps I am missing some other mechanism for receiving this event.
### Expected Behavior
Ability to register an event handler for build completion.
### Current Behavior
The buildFinished event has been deprecated with no apparent replacement.
### Context
Deprecation in Gradle 7.4.
Vampire
(Björn Kautler)
September 27, 2022, 1:06pm
3
Sure there is, it is just a “bit” more verbose.
You need to create a build service that implements OperationCompletionListener
and AutoCloseable
.
Then you register the build service as OperationCompletionListener
and do your build finished logic in the close
method.
IsaevMH
(Isaev Maxim)
October 18, 2022, 3:05pm
4
Can you elaborate on your proposal please?
Vampire
(Björn Kautler)
October 18, 2022, 3:24pm
5
Please first read the docs at Shared Build Services and if you still have questions, please ask them in detail.