How to avoid code generation of the refered ecore file in genmodel file [message #1830264] |
Wed, 22 July 2020 08:03  |
Eclipse User |
|
|
|
I created A.ecore and B.ecore files in seperated emf projects(A project for A.ecore, B project for B.ecore).
For A.ecore, I created A.genmodel and generated java code from it and added it into the "dependencies" of B project.
I open B.ecore in Ecore Model Editor and Loaded(by "Load Resource..." popup menu) A.ecore file into the same Ecore Model Editor.
In B.ecore, I created EClass YYY and created a EReference for it, refered a Eclass XXX of A.ecore.
Then I created B.genmodel for B.ecore.
I open B.genmodel in EMF Generator Editor and there were B.ecore and A.ecore.
I did not need generating code from A.ecore in B project, So I deleted A.ecore.
Then I choosed "Generate All" from popup menu for B.ecore.
There was the problem, in MANIFEST.MF, it exported packages of A.ecore in "Runtime" Tab, But there was no package of A.ecore in the B project and the eclipse show me errors.
I want to kown how to avoid B project export packages of A.ecore after generating code from B.ecore ?
Thanks a lot!
|
|
|
|
Re: How to avoid code generation of the refered ecore file in genmodel file [message #1830299 is a reply to message #1830276] |
Wed, 22 July 2020 23:38   |
Eclipse User |
|
|
|
In Ecore Model Editor of ladder.ecore , I loaded PLCVariables.ecore.


Then I created an EClass xxx for ladder.ecore, and created an EReference for xxx and refered an EClass yyy of PLCVariables.ecore.
I open ladder.gemodel in EMF Generator Editor. The plcvariables was shown under Ladder.

On "Model" node in EMF Generator Editor of ladder.genmodel, I selected "Generate All" from popup menu.

After genreating the code, The eclipse show me errors.

The EMF added packages of plcvariables.ecore into "Runtime" . But there was no package of plcvariables.ecore in ladder.model's project.
My question is : How can I avoid those errors? I generated code of plcvariables.ecore in plcvariables.ecore's project, I added those generated packages of plcvaraibles.ecore into "dependencies" of ladder.ecore's project.How can I disable emf add pakcages of refered plcvariables.ecore automatically? I do not need those packages in ladder.ecore's project.

Attachment: 1.png
(Size: 19.15KB, Downloaded 594 times)
Attachment: 2.png
(Size: 13.74KB, Downloaded 551 times)
Attachment: 3.png
(Size: 7.81KB, Downloaded 568 times)
Attachment: 4.png
(Size: 25.29KB, Downloaded 575 times)
Attachment: 7.png
(Size: 85.70KB, Downloaded 589 times)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03750 seconds