java - Using Xtext generated artifacts -


i'm looking xtext create both reusable dsl , artifact built upon dsl. simplified project layout follows:

  • projecta: contains xtext-based dsl, feature-project, updatesite, etc.
  • projectb: uses artifacts projecta generate code.
  • projectc: uses generated code projectb

building projecta using maven , xtext not problem (and there several examples on net already), don't how use dsl projecta inside projectb , release generated code consumption in projectc. tutorials, documentation , every example find, using generated eclipse plugin projecta generate code in projectb. although works fine, i'm wondering how reuse generated code.

is possible use code generator projecta maven or similar? how supposed use dsl in continuous integration server? have run eclipse headless that?

it seems me, i'm missing obvious. pointers, hints, examples welcome!

it possible generate code xtext using fornax mwe runner (sadly not available in maven central in http://www.fornax-platform.org/m2/repository).

we use approach in emf-incquery (corresponding pom file) based on tycho based compilation

1. configure clean plugin empty src-gen , xtend-gen folders (from related projects, such core, test , ui projects) 2. use fornax plugin execute mwe2 workflow 3. execute xtend compiler (some code generated xtend classes)

additional (mostly repository , xtend compiler version) configuration added parent pom of our build.

update: answered wrong question; sorry. trying different answer.

first of all, have implement language/compiler in way integratable in headless environment (see way xtend-maven-compiler packaged).

your grammar has generator (implementing igenerator interface) receives model , helper class file creation. in case of xbase-using grammar, generator implemented xtext, otherwise should have implemented it.

then can provide additional project utilizes generator, , able generate such code. basically, use languages standalonesetup/headless injector igenerator instance (in new project), , add new filesystemaccess instance parameterized according build.

then project should reference original project - e.g. can plug-in project, build tycho, , use jar-based compiler; or can create pure maven plug-in in case might need manually select transitive dependencies required xtext.

in case of xtend-maven-compiler plugin solved creating 'uberjar' copying dependencies single jar file, , referred. ugly, works.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -