2
votes

I have a complete EMF-Metamodell (ecore) created. Now I want to try Code-Generation with Xtext2, because I found somewhere that xtext2 is better for code generation than xpand.

I created a new Project with Eclipse and imported my existing ecore-model. I use the new Project with Xtend to do the code-generation.

  1. I dont like the default convertion to xtext. To many curly braces and other stuff. Can I define somehow how I want it converted?
  2. When I change my Meta-Model (ecore) how can I enforce an update of the xtext file?
  3. Is there a better way to achieve my goals?
1
Have you solved this? Especially point #2 is of my interest. - vikin9

1 Answers

0
votes

If you've chosen xtext as your model-to-test generation technology, why not use it to also generate the xtext source from the ecore model? This is a standard templating approach.

As for enforcing a re-gen when your score source changes, create an Eclipse builder and configure your ecore project to invoke the build on any resource change within the project.