Tuesday, May 4, 2010

Dynamic Ecore with Acceleo - Editing and packaging

In the Android example I presented at Eclipse Con 2010, we start by creating an ecore file with a set of domain model elements, including the "Activity" and the "Widget" concepts. When editing the code generation MTL module files, we need access to the Android ecore concepts. We need to improve both the ecore file and the code generator. It's easier to do if we are able to edit the code generator and the domain metamodel in the same eclipse instance.

We identify the domain ecore metamodel with its NsURI. In Acceleo 3.0, it is now possible to defined, in the MTL module file header, the NsURI of a dynamic Ecore/EPackage (even though it is defined in the same eclipse workspace). For instance, in the following picture, we are editing the "edit.mtl" file based on the "android.ecore" metamodel which is located in the same workspace.


The packaging of an Acceleo project is not more complicated than the packaging an Eclipse plug-in. In this case of a dynamic ecore file, you have to know that you need to export all the required plug-ins, including the project which includes the "android.ecore" file.

3 comments:

Marcos Fedato said...
This comment has been removed by the author.
Marcos Fedato said...

Cool, i had develped a modeling tool that does not uses UML classes, i thint that now, with this custom ecore i can use acceleo with code completion to build generators for it

I wil report my experience as soon as it ends

thanks for the post

Jeff Axelrod said...
This comment has been removed by the author.