eMoflon / emoflon-ibex

Shared, eMoflon-specific component for incremental unidirectional and bidirectional graph transformations
GNU General Public License v3.0
12 stars 4 forks source link

Automate Package registration #31

Closed anthonyanjorin closed 7 years ago

anthonyanjorin commented 7 years ago

For imports in the TGG editor of the form "platform:/resource//.ecore" we can automatically generate code performing the registration of the ecore file as follows:

Resource r = resourceSet.getResource(URI.createFileURI("../<project>/<pathToEcore>.ecore"));
EPackage p = (EPackage)r.getContents().get(0);
Registry.eINSTANCE.put(r.getURI().toString(), p);
Registry.eINSTANCE.put(p.getNSURI(), p);
Registry.eINSTANCE.put("platform:/resource/<project>/<pathToEcore>.ecore", p);

For all other imports we should generate a TODO for the user:

//TODO: Register EPackage for dependency: <import>
Arikae commented 7 years ago

Already done in #95