|Re: How to generate java files from inc query definition file (.eiq files) [message #1715929 is a reply to message #1715877]
||Fri, 27 November 2015 21:15
| Zoltan Ujhelyi
Registered: July 2015
if I understand you correctly, you have managed to create an .ecore and a .genmodel file for your metamodel, but don't have its generated code available (not related to EMF-IncQuery at all; I am talking about the generated model code from EMF). If you are the creator of the metamodel, you should open the .genmodel file, and execute code generation from it (see the following tutorial for details: http://www.vogella.com/tutorials/EclipseEMF/article.html#emfmodel); if you are using an existing metamodel, it plug-in should also include the EPackage implementation.
Example: I want to reuse the UML metamodel implementation from EMF provided by the org.eclipse.uml2.uml plugin, I have to add the dependency to the defining plug-in, and refer to the EMF-generated UMLPackage class (and I have to duplicate the dependency here, as this Maven plug-in cannot reuse the dependencies from manifest.mf).
Almost always this is the recommended way to refer to metamodels for the maven-compiler. The single notable exception to this rule is the case when both the metamodel and the patterns are specified in the same project. In that case, adding a reference to the .genmodel file would do the trick required.
One more thing: the EMF-IncQuery generator _expects_ the generated metamodel code from EMF to be available during runtime, it does not generate it. If you are the provider of this code, you could either upload it to the repository, or use something like the maven snippet from https://gist.github.com/hwellmann/6044835
Powered by FUDForum
. Page generated in 0.02261 seconds