use of org.gradle.launcher.daemon.server.api.DaemonStateControl in project gradle by gradle.
the class StartBuildOrRespondWithBusy method doBuild.
protected void doBuild(final DaemonCommandExecution execution, final Build build) {
DaemonStateControl stateCoordinator = execution.getDaemonStateControl();
try {
Runnable command = new Runnable() {
public void run() {
LOGGER.info("Daemon is about to start building {}. Dispatching build started information...", build);
execution.getConnection().buildStarted(new BuildStarted(diagnostics));
execution.proceed();
}
};
stateCoordinator.runCommand(command, execution.toString());
} catch (DaemonUnavailableException e) {
LOGGER.info("Daemon will not handle the command {} because is unavailable: {}", build, e.getMessage());
execution.getConnection().daemonUnavailable(new DaemonUnavailable(e.getMessage()));
} catch (DaemonStoppedException e) {
execution.getConnection().completed(new Failure(e));
}
}
Aggregations