Search in sources :

Example 1 with DialyzerErrorException

use of org.erlide.dialyzer.builder.DialyzerUtils.DialyzerErrorException in project erlide_eclipse by erlang.

the class DialyzerBuilder method build.

public void build(final BuildNotifier notifier) throws CoreException {
    if (project == null) {
        return;
    }
    DialyzerPreferences prefs = null;
    prefs = DialyzerPreferences.get(project);
    if (prefs == null || !prefs.getDialyzeOnCompile()) {
        return;
    }
    final IErlElementLocator model = ErlangEngine.getInstance().getModel();
    final Set<IErlModule> modules = DialyzerUtils.collectModulesFromResource(model, project);
    final Set<IErlProject> projects = Sets.newHashSet();
    projects.add(model.findProject(project));
    DialyzerMarkerUtils.removeDialyzerMarkersFor(project);
    if (!modules.isEmpty()) {
        try {
            final IErlProject eproject = model.findProject(project);
            if (eproject == null) {
                return;
            }
            final IBackend backend = BackendCore.getBackendManager().getBuildBackend(eproject);
            DialyzerUtils.doDialyze(notifier.monitor, modules, projects, backend);
        } catch (final InvocationTargetException e) {
            ErlLogger.error(e);
        } catch (final DialyzerErrorException e) {
            ErlLogger.error(e);
            final String msg = NLS.bind(BuilderMessages.build_dialyzerProblem, e.getLocalizedMessage());
            DialyzerMarkerUtils.addProblemMarker(project, null, null, msg, 0, IMarker.SEVERITY_ERROR);
        }
    }
}
Also used : IErlProject(org.erlide.engine.model.root.IErlProject) IBackend(org.erlide.backend.api.IBackend) IErlModule(org.erlide.engine.model.root.IErlModule) IErlElementLocator(org.erlide.engine.model.root.IErlElementLocator) DialyzerPreferences(org.erlide.dialyzer.builder.DialyzerPreferences) InvocationTargetException(java.lang.reflect.InvocationTargetException) DialyzerErrorException(org.erlide.dialyzer.builder.DialyzerUtils.DialyzerErrorException)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 IBackend (org.erlide.backend.api.IBackend)1 DialyzerPreferences (org.erlide.dialyzer.builder.DialyzerPreferences)1 DialyzerErrorException (org.erlide.dialyzer.builder.DialyzerUtils.DialyzerErrorException)1 IErlElementLocator (org.erlide.engine.model.root.IErlElementLocator)1 IErlModule (org.erlide.engine.model.root.IErlModule)1 IErlProject (org.erlide.engine.model.root.IErlProject)1