Which method can replace getProject().getGradle().buildFinished()?

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.

It appears there’s no complete solution for this yet, but here’s some more details.

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.

Can you elaborate on your proposal please?

Please first read the docs at Shared Build Services and if you still have questions, please ask them in detail.