Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Generator: Generate Imported-Package Dependency instead of Required Plugin
Generator: Generate Imported-Package Dependency instead of Required Plugin [message #1778846] Fri, 22 December 2017 12:56 Go to next message
Simon BBBBBBB is currently offline Simon BBBBBBBFriend
Messages: 54
Registered: March 2015
Member
Hello,

i have an emf-model from wich i generate into a seperate model-, edit- and editor-project. another model references this model and generates source-code in the same way, but with plugin-dependencys to the first emf-model.

for my runtimeworkspace, i need to replace the sources from the first model with sources from another model, that has at least the same classes in the same packages (maybe some more).

this causes a ClassNotFoundException. i did some research and think that this has to do with the osgi-framework and the way osgi resolves classes. but i found a solution for my problem: i can replace the plugin-dependencys from my second plugin with Imported-Package-Dependencys.

My Question is: is there a way to generate the dependencys for the edit and editor-project as imported-package-dependend instead of required-pluing dependend? so that i dont have to do it every time by hand? e.g. a setting in the genmodel-file?

if not: any other ideas?

Thank you.
Simon
Re: Generator: Generate Imported-Package Dependency instead of Required Plugin [message #1778853 is a reply to message #1778846] Fri, 22 December 2017 14:20 Go to previous messageGo to next message
Ed Merks is currently online Ed MerksFriend
Messages: 29453
Registered: July 2009
Senior Member
No, EMF will not generate package imports. But in the GenModel you can set Update Classpath to false and then the generator will not modify the MANIFEST.MF so your hand-written changes won't be modified nor will any other changes be made to the MANIFEST.MF.
Re: Generator: Generate Imported-Package Dependency instead of Required Plugin [message #1779320 is a reply to message #1778853] Fri, 05 January 2018 10:13 Go to previous messageGo to next message
Simon BBBBBBB is currently offline Simon BBBBBBBFriend
Messages: 54
Registered: March 2015
Member
Hi Ed, thank you for your answer (as always!)

is there a way to modify the genmodel-generator? with jetemitter or something, so that i can build the functionality myself?
Re: Generator: Generate Imported-Package Dependency instead of Required Plugin [message #1779323 is a reply to message #1779320] Fri, 05 January 2018 11:18 Go to previous messageGo to next message
Ed Merks is currently online Ed MerksFriend
Messages: 29453
Registered: July 2009
Senior Member
With dynamic templates https://wiki.eclipse.org/EMF/FAQ#What_are_Dynamic_Templates.3F you could override the each of the MANIFEST.MF templates. But unless you have a whole whack of projects for which you need to do this, that's likely much more work than changing them manually.
Re: Generator: Generate Imported-Package Dependency instead of Required Plugin [message #1779326 is a reply to message #1779323] Fri, 05 January 2018 12:33 Go to previous messageGo to next message
Simon BBBBBBB is currently offline Simon BBBBBBBFriend
Messages: 54
Registered: March 2015
Member
Hey Ed. Thanks another time. I found it and i know what to do, but i need to extend the GenModelImpl. Can you point me in the right direction where i can exchange the used Implementation?

My idea is to replace the GenModelActionBarContributor with my own generate-Actions. is there a better way?

[Updated on: Fri, 05 January 2018 12:59]

Report message to a moderator

Re: Generator: Generate Imported-Package Dependency instead of Required Plugin [message #1779340 is a reply to message #1779326] Fri, 05 January 2018 16:03 Go to previous message
Ed Merks is currently online Ed MerksFriend
Messages: 29453
Registered: July 2009
Senior Member
I think you should be able to do it without extending the GenModel, hopefully, because that's way way more complicated. Then you need your own importer to ensure that your derived GenModel is created. Try to implement things using dynamic templates that external static utility methods first.
Previous Topic:Maven Repository for Jars from Eclipse Oxygen (EMF 2.13)
Next Topic:Index of model element with in a container
Goto Forum:
  


Current Time: Wed Jul 18 17:51:24 GMT 2018

Powered by FUDForum. Page generated in 0.02395 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top