use of org.gradle.process.internal.ExecHandle in project gradle by gradle.
the class DefaultDaemonStarter method startProcess.
private DaemonStartupInfo startProcess(List<String> args, File workingDir, InputStream stdInput) {
LOGGER.info("Starting daemon process: workingDir = {}, daemonArgs: {}", workingDir, args);
Timer clock = Timers.startTimer();
try {
GFileUtils.mkdirs(workingDir);
DaemonOutputConsumer outputConsumer = new DaemonOutputConsumer(stdInput);
ExecHandle handle = new DaemonExecHandleBuilder().build(args, workingDir, outputConsumer);
handle.start();
LOGGER.debug("Gradle daemon process is starting. Waiting for the daemon to detach...");
handle.waitForFinish();
LOGGER.debug("Gradle daemon process is now detached.");
return daemonGreeter.parseDaemonOutput(outputConsumer.getProcessOutput());
} catch (GradleException e) {
throw e;
} catch (Exception e) {
throw new GradleException("Could not start Gradle daemon.", e);
} finally {
LOGGER.info("An attempt to start the daemon took {}.", clock.getElapsed());
}
}
Aggregations