Clock clock = new Clock();
try {
GFileUtils.mkdirs(workingDir);
DaemonOutputConsumer outputConsumer = new DaemonOutputConsumer();
ExecHandle handle = new DaemonExecHandleBuilder().build(args, workingDir, outputConsumer);
handle.start();
LOGGER.debug("Gradle daemon process is starting. Waiting for the daemon to detach...");
ExecResult result = handle.waitForFinish();
LOGGER.debug("Gradle daemon process is now detached.");