Package org.erlide.runtime.runtimeinfo

Examples of org.erlide.runtime.runtimeinfo.RuntimeInfo$Builder


    public long getStartIndex() {
        return startIndex;
    }

    private IBackend createBackend() {
        final RuntimeInfo erlideRuntime = BackendCore.getRuntimeInfoCatalog()
                .getErlideRuntime();
        if (erlideRuntime == null) {
            return null;
        }
        final RuntimeInfo info = new RuntimeInfo(erlideRuntime);
        try {
            final BackendData data = getBackendData(info);
            data.setUseStartShell(true);
            final IBackend b = BackendCore.getBackendManager().createExecutionBackend(
                    data);
View Full Code Here


    public void setInternal(final boolean internal) {
        this.internal = internal;
    }

    public String[] getCmdLine() {
        final RuntimeInfo r = getRuntimeInfo();
        final List<String> result = new ArrayList<String>();

        if (hasDetachedConsole() && !isInternal()) {
            if (SystemConfiguration.getInstance().isOnWindows()) {
                result.add("cmd.exe");
                result.add("/c");
                result.add("start");
            } else {
                final String command = System.getenv().get("TERM");
                result.add(command);
                result.add("-e");
            }
        }

        String erl = r.getOtpHome() + "/bin/erl";
        if (erl.indexOf(' ') >= 0) {
            erl = "\"" + erl + "\"";
        }
        result.add(erl);
        for (final String path : r.getCodePath()) {
            if (!Strings.isNullOrEmpty(path)) {
                result.add("-pa");
                result.add(path);
            }
        }
        if (!useStartShell()) {
            result.add("-noshell");
        }

        if (!getNodeName().equals("")) {
            final String nameTag = hasLongName() ? "-name" : "-sname";
            String nameOption = getNodeName();
            if (!nameOption.contains("@")) {
                nameOption += "@" + HostnameUtils.getErlangHostName(hasLongName());
            }
            result.add(nameTag);
            result.add(nameOption);
            final String cky = getCookie();
            if (!Strings.isNullOrEmpty(cky)) {
                result.add("-setcookie");
                result.add(cky);
            }
        }
        final String gotArgs = r.getArgs();
        if (!Strings.isNullOrEmpty(gotArgs)) {
            result.addAll(splitQuoted(gotArgs));
        }
        return result.toArray(new String[result.size()]);
    }
View Full Code Here

    @Override
    public String getText(final Object element) {
        final IBackend b = (IBackend) element;
        final BackendData data = b.getData();
        final RuntimeInfo info = data.getRuntimeInfo();
        final String s = info != null ? info.getName() : "<none>";
        return s + ": " + data.getNodeName();
    }
View Full Code Here

                    return it.toString();
                  }
                };
                List<String> _map = ListExtensions.<RuntimeVersion, String>map(((List<RuntimeVersion>)Conversions.doWrapArray(runtimeVersions)), _function);
                it.setItems(((String[])Conversions.unwrapArray(_map, String.class)));
                RuntimeInfo _bestRuntime = ErlangProjectBuilderPage.this.info.bestRuntime();
                RuntimeVersion _version = _bestRuntime.getVersion();
                RuntimeVersion _asMajor = _version.asMajor();
                String _string = _asMajor.toString();
                it.setText(_string);
                String _text = it.getText();
                RuntimeVersion _parse = RuntimeVersion.Serializer.parse(_text);
View Full Code Here

        return cachedRuntimeInfo;
    }

    @Override
    public RuntimeVersion getRuntimeVersion() {
        final RuntimeInfo runtimeInfo = getRuntimeInfo();
        if (runtimeInfo != null) {
            return runtimeInfo.getVersion();
        }
        // should not happen
        return null;
    }
View Full Code Here

        final List<String> rtl = new ArrayList<String>();
        for (final RuntimeInfo r : runtimes) {
            rtl.add(r.getName());
        }
        final String[] rts = rtl.toArray(new String[] {});
        final RuntimeInfo defaultRuntime = BackendCore.getRuntimeInfoCatalog()
                .getDefaultRuntime();
        final int db = defaultRuntime == null ? 0 : Arrays.binarySearch(rts,
                defaultRuntime.getName());

        runtimesCombo = new Combo(comp, SWT.READ_ONLY);
        final GridData gd_runtimesCombo = new GridData(174, SWT.DEFAULT);
        gd_runtimesCombo.horizontalAlignment = SWT.FILL;
        runtimesCombo.setLayoutData(gd_runtimesCombo);
View Full Code Here

        doOkPressed();
        super.okPressed();
    }

    private void doOkPressed() {
        final RuntimeInfo info = new RuntimeInfo(fName.getText().trim(), fOtpHome
                .getText().trim(), fArgs.getText().trim(), fCodePath.getElements());
        fRequestor.itemAdded(info);
    }
View Full Code Here

    // RuntimeInfo getRuntimeInfo();
    @Test
    public void getRuntimeInfo() throws Exception {
        final IErlProject aProject = project2;
        final RuntimeInfo info = aProject.getRuntimeInfo();
        // final String expected = ResourcesPlugin.getWorkspace().getRoot()
        // .getLocation().toString();
        assertNotNull(info);
        // The working dir might be relative to the project and can also be "."
        // We need to convert it to a canonical absolute path in order to be
View Full Code Here

                final Cursor cursor = new Cursor(parent.getDisplay(), SWT.CURSOR_WAIT);
                try {
                    parent.setCursor(cursor);
                    parent.setEnabled(false);

                    final RuntimeInfo runtime = BackendCore.getRuntimeInfoCatalog()
                            .getErlideRuntime();
                    HostnameUtils.detectHostNames(runtime.getOtpHome());
                    updateHostNames();
                } finally {
                    parent.setCursor(null);
                    parent.setEnabled(true);
                    cursor.dispose();
View Full Code Here

public class RuntimeInfoTest {

    @Test
    public void codePath_Runtime_1() {
        final RuntimeInfo info = new RuntimeInfo("dummy");
        final Collection<String> pa = info.getCodePath();
        assertThat(pa.size(), is(0));
    }
View Full Code Here

TOP

Related Classes of org.erlide.runtime.runtimeinfo.RuntimeInfo$Builder

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.