LOGGER.info("Starting daemon process: workingDir = {}, daemonArgs: {}", workingDir, args);
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.");
return daemonGreeter.parseDaemonOutput(outputConsumer.getProcessOutput(), result);
} catch (GradleException e) {
throw e;
} catch (Exception e) {
throw new GradleException("Could not start Gradle daemon.", e);
} finally {