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>
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:
For all other imports we should generate a TODO for the user: