Juan Tamayo
Juan Tamayo

Reputation: 155

Is it possible to use Xtext without eclipse?

I have a DSL (implemented with ANTLR) for which I need to write a content assist/autocomplete editor. I've ported a prototype of my grammar to Xtext, and I'm quite happy with the quality of the editor it generates.

Unfortunately, I cannot use Eclipse as my editor. Instead, I'd like use the Xtext grammar to generate some artifacts that I could reuse outside of Eclipse. From what I've seen, the minimum set of artifacts I need are:

Has anyone tried to use Xtext outside of Eclipse? How many external libraries does it depend on?

Thanks!

Upvotes: 12

Views: 3503

Answers (4)

thSoft
thSoft

Reputation: 22650

With Xtext 2.9, it is possible to build your language infrastructure independent of Eclipse (and possibly targeting IntelliJ IDEA or the web), using plain old Maven/Gradle. Just uncheck the Eclipse plugin facet when creating an Xtext project and set the Preferred Build System to Maven or Gradle.

Upvotes: 1

Alexander
Alexander

Reputation: 342

You can use command line mode of xtext application. For this purposes : you schould in workflow description file GenerationYourDSLName.mwe2 the following lines

// generator API
fragment = generator.GeneratorFragment {
  generateJavaMain = true
}

then generate xtext artifacts

Upvotes: 1

Adam Schmideg
Adam Schmideg

Reputation: 10850

Essentially the same answer as the one given by Christian, this is just a pointer to a more detailed description of How to Deploy Xtext to a Headless Plain-Java Environment. If you are interested in using the artifacts generated from the grammar, you can find a snippet in the XText FAQ

Upvotes: 8

Christian Dietrich
Christian Dietrich

Reputation: 11868

for the backend part (parser / serializer / formatter / metamodel etc) this is not problem and it will require about 30 libaries / 17MB. the ui part requires eclipse.

you can use the export -> runnable jar file wizard to get all dependent libs you need

Upvotes: 10

Related Questions