} catch (final CoreException e) {
// ignore it
}
}
final IBackend backend = BackendCore.getBackendManager().getBuildBackend(
erlProject);
if (backend == null) {
final String message = "No backend with the required "
+ "version could be found. Can't build.";
MarkerUtils.createProblemMarker(project, null, message, 0,
IMarker.SEVERITY_ERROR);
throw new BackendException(message);
}
final ErlangEventHandler handler = new BuilderEventHandler(backend.getName(),
notifier, project, state);
backend.getNodeProxy().registerEventListener(handler);
try {
try {
final OtpErlangObject projectInfo = BuilderUtils
.createProjectInfo(erlProject);
if (kind == BuildKind.FULL) {
backend.getOtpRpc().call(30000, "erlide_builder_rebar", "clean", "x",
projectInfo);
}
backend.getOtpRpc().call(30000, "erlide_builder_rebar", "build", "x",
projectInfo);
if (compileEunit) {
backend.getOtpRpc().call(30000, "erlide_builder_rebar",
"build_eunit", "x", projectInfo);
}
if (runXref) {
backend.getOtpRpc().call(30000, "erlide_builder_rebar", "xref", "x",
projectInfo);
}
if (runEunit) {
backend.getOtpRpc().call(30000, "erlide_builder_rebar", "eunit", "x",
projectInfo);
}
} catch (final RpcException e) {
ErlLogger.error(e);
}
} finally {
backend.getNodeProxy().unregisterEventListener(handler);
}
}