return null;
}
public DaemonClientConnection startDaemon(ExplainingSpec<DaemonContext> constraint) {
LOGGER.info("Starting Gradle daemon");
final DaemonStartupInfo startupInfo = daemonStarter.startDaemon();
LOGGER.debug("Started Gradle daemon {}", startupInfo);
long expiry = System.currentTimeMillis() + connectTimeout;
do {
DaemonClientConnection daemonConnection = connectToDaemonWithId(startupInfo, constraint);
if (daemonConnection != null) {
return daemonConnection;
}
try {
Thread.sleep(200L);
} catch (InterruptedException e) {
throw UncheckedException.throwAsUncheckedException(e);
}
} while (System.currentTimeMillis() < expiry);
throw new DaemonConnectionException("Timeout waiting to connect to the Gradle daemon.\n" + startupInfo.describe());
}