Package org.erlide.backend.api

Examples of org.erlide.backend.api.IBackend


 
  public String getOsCommand(final IErlProject erlProject) {
    String _xblockexpression = null;
    {
      IBackendManager _backendManager = BackendCore.getBackendManager();
      final IBackend backend = _backendManager.getBuildBackend(erlProject);
      IOtpNodeProxy _nodeProxy = backend.getNodeProxy();
      String _otpHome = _nodeProxy.getOtpHome();
      Path _path = new Path(_otpHome);
      final IPath path = _path.append("bin/erl");
      String _xifexpression = null;
      SystemConfiguration _instance = SystemConfiguration.getInstance();
View Full Code Here


    public void crashedBackendShouldRestart() {
        final BackendData data = new BackendData(RuntimeCore.getRuntimeInfoCatalog()
                .getDefaultRuntime());
        data.setNodeName("fooz");
        data.setLongName(false);
        final IBackend b = BackendCore.getBackendManager().getFactory()
                .createBackend(data);
        assertThat("backend not running", b.isRunning());
        try {
            Thread.sleep(1000);
        } catch (final InterruptedException e) {
        }
        final Process oldProcess = b.getErtsProcess().getProcess();
        oldProcess.destroy();
        try {
            Thread.sleep(1000);
        } catch (final InterruptedException e) {
        }
        // this is needed to internally reset erts
        b.getErtsProcess().shutDown();
        assertThat("backend not running", b.isRunning());
        final Process newProcess = b.getErtsProcess().getProcess();
        assertThat(newProcess, is(not(oldProcess)));
    }
View Full Code Here

    public void closedBackendShouldNotRestart() {
        final BackendData data = new BackendData(RuntimeCore.getRuntimeInfoCatalog()
                .getDefaultRuntime());
        data.setNodeName("fooz");
        data.setLongName(false);
        final IBackend b = BackendCore.getBackendManager().getFactory()
                .createBackend(data);
        assertThat("backend not running", b.isRunning());
        try {
            Thread.sleep(1000);
        } catch (final InterruptedException e) {
        }
        b.dispose();
        try {
            Thread.sleep(1000);
        } catch (final InterruptedException e) {
        }

        assertThat("backend not running", !b.isRunning());
        final ErtsProcess erts = b.getErtsProcess();
        final Process newProcess = erts.getProcess();
        assertThat(newProcess, is(nullValue()));
    }
View Full Code Here

        }

        @Override
        protected IStatus run(final IProgressMonitor monitor) {
            if (!modules.isEmpty()) {
                IBackend backend = null;
                monitor.beginTask("Dialyzing", IProgressMonitor.UNKNOWN);

                try {
                    backend = createBackend();
                    DialyzerUtils.doDialyze(monitor, modules, projects, backend);
                } catch (final OperationCanceledException e) {
                    ErlLogger.debug("Dialyzer operation was canceled");
                    return Status.CANCEL_STATUS;
                } catch (final DialyzerErrorException e) {
                    return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage());
                } catch (final InvocationTargetException e) {
                    return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getCause()
                            .getMessage());
                } finally {
                    if (backend != null) {
                        backend.dispose();
                    }
                    monitor.done();
                }

                ErlLogger.debug("Dialyzer operation ended successfully");
View Full Code Here

            try {
                final IErlProject eproject = model.findProject(project);
                if (eproject == null) {
                    return null;
                }
                final IBackend backend = BackendCore.getBackendManager().getBuildBackend(
                        eproject);
                DialyzerUtils.doDialyze(monitor, modules, projects, backend);
            } catch (final InvocationTargetException e) {
                ErlLogger.error(e);
            } catch (final DialyzerErrorException e) {
View Full Code Here

            } 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);
        }
    }
View Full Code Here

        try {
            initializeBuilder(project, notifier);
            MarkerUtils.removeProblemMarkersFor(project);

            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);
            }

            try {
                final OtpErlangObject projectInfo = BuilderUtils
                        .createProjectInfo(erlProject);
                backend.getOtpRpc().call("erlide_builder_rebar", "clean", "x",
                        projectInfo);
                project.refreshLocal(IResource.DEPTH_INFINITE, null);

            } catch (final RpcException e) {
                ErlLogger.error(e);
View Full Code Here

            createRequest(ErlDebugConstants.REQUEST_INSTALL);
        }
    }

    private void createRequest(final int request) {
        final IBackend b = target.getBackend();
        int line = -1;
        try {
            line = getLineNumber();
        } catch (final CoreException e) {
            ErlLogger.warn(e);
View Full Code Here

    }

    @Override
    public IBackend createExecutionBackend(final BackendData data) {
        ErlLogger.debug("create execution backend " + data.getNodeName());
        final IBackend b = factory.createBackend(data);
        addBackend(b);
        notifyBackendChange(b, BackendEvent.ADDED, null, null);
        return b;
    }
View Full Code Here

            ErlLogger
                    .info("Project %s has no runtime info, using ide", project.getName());
            return getIdeBackend();
        }
        final String version = info.getVersion().asMajor().toString();
        IBackend b = buildBackends.get(version);
        if (b == null) {
            b = factory.createBuildBackend(info);
            buildBackends.put(version, b);
            addBackend(b);
            notifyBackendChange(b, BackendEvent.ADDED, null, null);
View Full Code Here

TOP

Related Classes of org.erlide.backend.api.IBackend

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.