How to stop the daemon after finished using the toolingApi

I see the daemon process running after my toolingApi code is finished.

I can stop it from the command line with “gradle --stop”

BUT…can it be stopped with the toolingApi???

No, there is no support for this in Tooling API. You can tell Gradle to quit soon after your request by passing a system property specifying a short idle timeout. See related thread