Skip to main content



      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 07:56 Go to next message
Eclipse UserFriend
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 09:20 Go to previous messageGo to next message
Eclipse UserFriend
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 05:13 Go to previous messageGo to next message
Eclipse UserFriend
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 06:18 Go to previous messageGo to next message
Eclipse UserFriend
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 07:33 Go to previous messageGo to next message
Eclipse UserFriend
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 07:59] by Moderator

Re: Generator: Generate Imported-Package Dependency instead of Required Plugin [message #1779340 is a reply to message #1779326] Fri, 05 January 2018 11:03 Go to previous message
Eclipse UserFriend
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: Tue Jul 15 21:54:07 EDT 2025

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

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

Back to the top