Compile a DSL developed in Xtext and Xpand on command line

913 views Asked by At

It seems like a DSL (Domain-specific Language) developed in Xtext and Xpand is very much bound with Eclipse. Is there any way I can compile my DSL on command line, just like compiling Java code?

1

There are 1 answers

0
Zoltán Ujhelyi On

If you have a mwe workflow to execute your generator with, it can be executed from the command line as well. Look for the Mwe2Launcher class (http://git.eclipse.org/c/emf/org.eclipse.mwe.git/tree/plugins/org.eclipse.emf.mwe2.launch/src/org/eclipse/emf/mwe2/launch/runtime/Mwe2Launcher.java) for details.

If you already execute your Xpand generator from Java, then you have to simply wrap its call into an executable command line application.

In both case, you can either create an Eclipse application with all the dependencies by defining an Eclipse product that contains Xtext, Xpand, your plug-ins (and mwe if needed).