Search in sources :

Example 16 with RuntimeVersion

use of org.erlide.runtime.runtimeinfo.RuntimeVersion in project erlide_eclipse by erlang.

the class BackendData method asLaunchConfiguration.

public ILaunchConfiguration asLaunchConfiguration() {
    final ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
    final ILaunchConfigurationType type = manager.getLaunchConfigurationType(IErlangLaunchDelegateConstants.CONFIGURATION_TYPE_INTERNAL);
    ILaunchConfigurationWorkingCopy workingCopy;
    try {
        final RuntimeInfo info = getRuntimeInfo();
        final String name = getNodeName();
        workingCopy = type.newInstance(null, name);
        if (info.getVersion().isReleaseCompatible(new RuntimeVersion(17))) {
            workingCopy.setAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, Charsets.UTF_8.name());
        } else {
            workingCopy.setAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, Charsets.ISO_8859_1.name());
        }
        workingCopy.setAttribute(DebugPlugin.ATTR_PROCESS_FACTORY_ID, "org.erlide.backend.ertsProcessFactory");
        workingCopy.setAttribute(ErlRuntimeAttributes.NODE_NAME, getNodeName());
        workingCopy.setAttribute(ErlRuntimeAttributes.RUNTIME_NAME, info.getName());
        workingCopy.setAttribute(ErlRuntimeAttributes.COOKIE, getCookie());
        // workingCopy.setAttribute(ErlLaunchAttributes.CONSOLE,
        // !options.contains(BackendOptions.NO_CONSOLE));
        workingCopy.setAttribute(ErlRuntimeAttributes.USE_LONG_NAME, hasLongName());
        workingCopy.setAttribute(ErlRuntimeAttributes.INTERNAL, isInternal());
        return workingCopy;
    } catch (final CoreException e) {
        ErlLogger.error(e);
        return null;
    }
}
Also used : RuntimeInfo(org.erlide.runtime.runtimeinfo.RuntimeInfo) CoreException(org.eclipse.core.runtime.CoreException) ILaunchConfigurationType(org.eclipse.debug.core.ILaunchConfigurationType) RuntimeVersion(org.erlide.runtime.runtimeinfo.RuntimeVersion) ILaunchManager(org.eclipse.debug.core.ILaunchManager) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)

Example 17 with RuntimeVersion

use of org.erlide.runtime.runtimeinfo.RuntimeVersion in project erlide_eclipse by erlang.

the class RuntimeVersionTest method compare_11c.

@Test
public void compare_11c() {
    final RuntimeVersion test1 = RuntimeVersion.Serializer.parse("R14");
    final RuntimeVersion test2 = RuntimeVersion.Serializer.parse("R16B");
    assertThat(test1.isCompatible(test2)).isEqualTo(false);
}
Also used : RuntimeVersion(org.erlide.runtime.runtimeinfo.RuntimeVersion) Test(org.junit.Test)

Example 18 with RuntimeVersion

use of org.erlide.runtime.runtimeinfo.RuntimeVersion in project erlide_eclipse by erlang.

the class RuntimeVersionTest method compare_2.

@Test
public void compare_2() {
    final RuntimeVersion test1 = RuntimeVersion.Serializer.parse("R12");
    final RuntimeVersion test2 = RuntimeVersion.Serializer.parse("R12A");
    assertThat(test1.compareTo(test2)).isLessThan(0);
}
Also used : RuntimeVersion(org.erlide.runtime.runtimeinfo.RuntimeVersion) Test(org.junit.Test)

Example 19 with RuntimeVersion

use of org.erlide.runtime.runtimeinfo.RuntimeVersion in project erlide_eclipse by erlang.

the class RuntimeVersionTest method toString_5.

@Test
public void toString_5() {
    final String expect = "17.0.0";
    final RuntimeVersion test = RuntimeVersion.Serializer.parse("17");
    assertThat(test.toString()).isEqualTo(expect);
}
Also used : RuntimeVersion(org.erlide.runtime.runtimeinfo.RuntimeVersion) Test(org.junit.Test)

Example 20 with RuntimeVersion

use of org.erlide.runtime.runtimeinfo.RuntimeVersion in project erlide_eclipse by erlang.

the class RuntimeVersionTest method compare_8.

@Test
public void compare_8() {
    final RuntimeVersion test1 = RuntimeVersion.Serializer.parse("17.0.0");
    final RuntimeVersion test2 = RuntimeVersion.Serializer.parse("17.1.0");
    assertThat(test1.compareTo(test2)).isLessThan(0);
}
Also used : RuntimeVersion(org.erlide.runtime.runtimeinfo.RuntimeVersion) Test(org.junit.Test)

Aggregations

RuntimeVersion (org.erlide.runtime.runtimeinfo.RuntimeVersion)33 Test (org.junit.Test)29 IProject (org.eclipse.core.resources.IProject)1 CoreException (org.eclipse.core.runtime.CoreException)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 Path (org.eclipse.core.runtime.Path)1 ILaunchConfigurationType (org.eclipse.debug.core.ILaunchConfigurationType)1 ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)1 ILaunchManager (org.eclipse.debug.core.ILaunchManager)1 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 SelectionListener (org.eclipse.swt.events.SelectionListener)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Combo (org.eclipse.swt.widgets.Combo)1 Composite (org.eclipse.swt.widgets.Composite)1 Label (org.eclipse.swt.widgets.Label)1 Text (org.eclipse.swt.widgets.Text)1 Pair (org.eclipse.xtext.xbase.lib.Pair)1