ssi-schaefer / lcdsl

Eclipse Launch Configuration DSL (Xtext based)
Eclipse Public License 1.0
23 stars 12 forks source link
eclipse eclipse-ide eclipse-plugin launch

lcdsl

Eclipse Launch Configuration DSL (Xtext based)

unstable

LcDsl provides a way of defining Eclipse launch configurations in a textual way. The file extension used is '.lc' It provides some obvious and some non-obvious advantages over the Eclipse launch configuration solution:

Currently, the LcDsl repository also provides the Launch Configuration View feature. See below for documentation on that.

Installation

Currently, the latest update site is hosted here: https://mduft.github.io/lcdsl-latest/ (P2 repository)

Ziped P2 repositories are provided for releases.

Demo

See these videos for a quick glance on what it is all about:

IMAGE ALT TEXT

IMAGE ALT TEXT

General

All launch configurations are built up the same way:

[modifiers..] [type] configuration [name] {
    [single-properties..] // properties that appear at most once
    [multi-properties..] // properties that can appear 0..N times
}

All kinds of launch configurations can define certain attributes the same. These are:

Multiple Arguments have to be quoted each, key and value separately, but may be written in one line:
vm-argument '-os' '${target.os}'

For all the above, check content assist to get an idea of the supported values and the exact syntax.

Note that variable expansion is supported throughout most string values in LcDsl (exceptions: regular expression for group post-launch action, RAP servlet/context path, trace specifications). Variables are defined in the Eclipse standard way (Window > Preferences > String Substitutions).

Java

The configuration type java has these attributes on top:

A typical java configuration looks like this:

java configuration LcJavaMain {
    project com.wamas.test;
    main-class com.wamas.test.JavaMain;

    memory min=64m max=256m;

    vm-argument '-Dmy.arg=value';
    argument 'cmdArg';
}

Eclipse, RAP, JUnit Plug-in, SWTBot

Eclipse, RAP, JUnit Plug-in and SWTBot launch configurations share a lot of configuration options, that is why they are described in the same chapter. The following attributes are added for these types:

Examples for typical eclipse, rap, junit-plugin and swtbot launch configurations:

eclipse configuration LcEclipseMain {
    workspace "${workspace_loc}/../runtime-MyWorkspace";
    application com.wamas.test.demo;

    clear workspace! config;
    memory min=64M max=256M;

    plugin com.wamas.test;

    environment DISPLAY=":0";
}

rap configuration LcRapMain {
    servlet {
        path '/test';
        port 8081;
    }

    plugin com.wamas.test;
}

junit-plugin configuration LcSWTBotMain {
    application com.wamas.test.demo;
    feature com.wamas.test.demo.feature;
    test {
        runner junit5;
        container '/com.wamas.test.demo.tests';
        exclude-tags long-running,ui-required;
    }
}

swtbot configuration LcSWTBotMain {
    application com.wamas.test.demo;
    plugin com.wamas.test.demo.plugin;
    test {
        runner junit4;
        container '/com.wamas.test.demo.swtbottests';
        class com.wamas.test.demo.swtbottests.MainTest;
        method 'testMain';
    }
}

Launch Groups

LcDsl allows to create Launch groups by using the group type and the member multi-property. Example:

group configuration MyGroup1 {
    adopt run member MyLaunchConfig1; // Launch Mode "Run" is used
    adopt inherit member MyLaunchConfig2; // Launch Mode "inherit" is used
    adopt run member MyLaunchConfig3 delay 2; // Two seconds post launch action
    adopt run member MyLaunchConfig4 wait; // Wait until terminated
    adopt run member MyLaunchConfig4 regex "Started"; // Wait until regular expression is found in console output
    adopt run member MyGroup2; // launch another group
}

Launch Configuration View

The launch configuration view is something that is actually independent of LcDsl itself. It depends on Eclipse platform.debug ONLY. It allows to hook (via OSGi services) launch configuration providers into it. It comes along with a default provider that allows it to handle "normal" Eclipse launch configurations. LcDsl brings along another provider for the view, that allows it to also handle LcDsl specifics.