| Summary: | Provide integration for MWE's EcoreGenerator and Xtext's EcoreGeneratorFragment | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Moritz Eysholdt <moritz.eysholdt> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | knut.wannheden, sven.efftinge |
| Version: | unspecified | Flags: | moritz.eysholdt:
indigo+
|
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Moritz Eysholdt
bug 329741 "[generator] make generated / referenced GenModels available to generator fragments" is related. For a customer project we implemented an Xtext generator fragment which generates code in the same way the MWE EcoreGenerator does, but based on the models derived from (or imported by) the Xtext grammar. That worked like a charm, but we encountered two problems which I think should be considered in this context: 1. The MWE EcoreGenerator does only allow to specify a single source folder to look for custom classes (e.g. XyzImplCustom.java). When there are multiple Ecore models involved with inheritance spanning model boundaries this is typically not enough. We simply extended the generator fragment with the possibility to specify multiple source directories which will all be searched in order. 2. The generation gap pattern as implemented does not seem to be applicable to the Ecore package and factory classes. I have not looked into this, but I have a feeling this could be more difficult. It's unfortunate however, as overriding the conversions for EDataTypes in the factory class is not all that uncommon. We didn't investigate this issue any further. (In reply to comment #2) > 1. The MWE EcoreGenerator does only allow to specify a single source folder to > look for custom classes (e.g. XyzImplCustom.java). When there are multiple > Ecore models involved with inheritance spanning model boundaries this is > typically not enough. We simply extended the generator fragment with the > possibility to specify multiple source directories which will all be searched > in order. I've opened a separate ticket fro this one https://bugs.eclipse.org/bugs/show_bug.cgi?id=334082 (In reply to comment #2) > > 2. The generation gap pattern as implemented does not seem to be applicable to > the Ecore package and factory classes. I have not looked into this, but I have > a feeling this could be more difficult. It's unfortunate however, as overriding > the conversions for EDataTypes in the factory class is not all that uncommon. > We didn't investigate this issue any further. Note: I reported this as bug 335089 against EMF. It has already been fixed in CVS HEAD (EMF 2.7). So in environments where EMF 2.7 is available the EcoreGenerator could now also be used for models like BuilderState.ecore. We should work on Xcore support instead. |