Search in sources :

Example 31 with RuntimeVersion

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

the class RuntimeVersionTest method toString_6.

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

Example 32 with RuntimeVersion

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

the class RuntimeVersionTest method toString_7.

@Test
public void toString_7() {
    final String expect = "17.4.0-rc1";
    final RuntimeVersion test = RuntimeVersion.Serializer.parse("17.4-rc1");
    assertThat(test.toString()).isEqualTo(expect);
}
Also used : RuntimeVersion(org.erlide.runtime.runtimeinfo.RuntimeVersion) Test(org.junit.Test)

Example 33 with RuntimeVersion

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

the class BackendManager method addCodeBundle.

private void addCodeBundle(final IExtension extension) {
    final String pluginId = extension.getContributor().getName();
    final Bundle plugin = Platform.getBundle(pluginId);
    final Multimap<CodeContext, String> paths = HashMultimap.create();
    final List<Pair<String, String>> inits = Lists.newArrayList();
    RuntimeVersion ver = RuntimeVersion.NO_VERSION;
    for (final IConfigurationElement el : extension.getConfigurationElements()) {
        if ("beam_dir".equals(el.getName())) {
            final String dir = el.getAttribute("path");
            final String t = el.getAttribute("context").toUpperCase();
            final CodeContext type = Enum.valueOf(CodeContext.class, t);
            paths.put(type, dir);
        } else if ("init".equals(el.getName())) {
            final String module = el.getAttribute("module");
            final String function = el.getAttribute("function");
            inits.add(new Pair<>(module, function));
        } else if ("otp_version".equals(el.getName())) {
            final String attribute = el.getAttribute("value");
            if (attribute != null) {
                ver = RuntimeVersion.Serializer.parse(attribute);
            }
        } else {
            ErlLogger.error("Unknown code bundle element: %s", el.getName());
        }
    }
    addBundle(plugin, ver, paths, inits);
}
Also used : ICodeBundle(org.erlide.backend.api.ICodeBundle) Bundle(org.osgi.framework.Bundle) CodeContext(org.erlide.backend.api.ICodeBundle.CodeContext) RuntimeVersion(org.erlide.runtime.runtimeinfo.RuntimeVersion) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement) Pair(org.eclipse.xtext.xbase.lib.Pair)

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