We build on our CI server with --no-daemon. However our tests use the tooling API to run other builds (we develop a plugin) and this starts daemons.
I’d like to make those daemons very short-lived. I’ve found references to org.gradle.daemon.idleTimeout but I just cannot inject it through the tooling API.
I’m trying to inject with in the BuilderLauncher (withArguments, setJvmArguments), I’m putting it in the gradle.properties of the test projects or my home folder, nothing works.
I’m trying to run tests in parallel which is going to start a dozen or more daemons and I don’t want them to stay around. How can I do this?
At the moment setting daemon idle time is only possible via an internal API. You have to utilise the fact that the instance returned from ‘GradleConnector.newConnector()’ is a ‘DefaultGradleConnector’: