Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Generated editor projects always break after metamodel modifications?
Generated editor projects always break after metamodel modifications? [message #640067] Thu, 18 November 2010 22:04 Go to next message
Glenview Jeff is currently offline Glenview JeffFriend
Messages: 79
Registered: September 2010
Member
Maybe I'm doing something wrong, but every time I modify my ecore metamodel using the sample hierarchical ecore editor, even doing something as simple as adding a new EClass, I get errors after re-generating (right-clicking on the genmodel file and selecting generate all.)

My generated src directory sometimes reports errors and almost always, the generated projects (.edit, .editor, .test) report errors.

The only way I know to fix this is to delete the generated projects, delete the generated src directory from the top-level project, delete the META-INF folder, and the plugin.xml file, then re-generate all. Sometimes I even have to delete and recreate the genmodel file in addition to the above.

There must be something obvious about the development workflow I'm missing here. I can't imagine EMF/ecore is really this brittle.

Thanks!
Jeff
Re: Generated editor projects always break after metamodel modifications? [message #640072 is a reply to message #640067] Thu, 18 November 2010 22:09 Go to previous messageGo to next message
Ed Merks is currently online Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Jeff,

Comments below.

glenviewjeff wrote:
> Maybe I'm doing something wrong, but every time I modify my ecore
> metamodel using the sample hierarchical ecore editor, even doing
> something as simple as adding a new EClass, I get errors after
> re-generating (right-clicking on the genmodel file and selecting
> generate all.)
>
> My generated src directory sometimes reports errors and almost always,
> the generated projects (.edit, .editor, .test) report errors.
What kind of errors?
>
> The only way I know to fix this is to delete the generated projects,
> delete the generated src directory from the top-level project, delete
> the META-INF folder, and the plugin.xml file, then re-generate all.
> Sometimes I even have to delete and recreate the genmodel file in
> addition to the above.
A clue about the errors will help me understand what you're describing.
>
> There must be something obvious about the development workflow I'm
> missing here. I can't imagine EMF/ecore is really this brittle.
No, it would be unusable. I'll need more details about the nature of
the errors to help you.
>
> Thanks!
> Jeff


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Generated editor projects always break after metamodel modifications? [message #641770 is a reply to message #640072] Sat, 27 November 2010 19:17 Go to previous messageGo to next message
Glenview Jeff is currently offline Glenview JeffFriend
Messages: 79
Registered: September 2010
Member
Thanks Ed. I don't seem to be having the same problems as before, so this thread can probably be disregarded. There is only one minor remaining issue.

If I delete a meta-model element using the default EMF/ecore editor and re-generate the model, I do get errors in the generated src directory (src-gen.) If I delete the src-gen directory and re-generate, the errors disappear.

Thanks,
Jeff
Re: Generated editor projects always break after metamodel modifications? [message #641773 is a reply to message #641770] Sat, 27 November 2010 20:01 Go to previous messageGo to next message
Ed Merks is currently online Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Jeff,

I wonder what kind of errors? When regenerating, unused imports aren't
removed and in no case will entire files ever be deleted. So you likely
need to do "Source->Organize Imports" and to delete files, if you've
deleted EClasses.


glenviewjeff wrote:
> Thanks Ed. I don't seem to be having the same problems as before, so
> this thread can probably be disregarded. There is only one minor
> remaining issue.
> If I delete a meta-model element using the default EMF/ecore editor
> and re-generate the model, I do get errors in the generated src
> directory (src-gen.) If I delete the src-gen directory and
> re-generate, the errors disappear.
>
> Thanks,
> Jeff


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Generated editor projects always break after metamodel modifications? [message #641910 is a reply to message #641773] Mon, 29 November 2010 08:38 Go to previous message
Eclipse UserFriend
Originally posted by: koen.yskout.cs.kuleuven.be

To easily see which files can be deleted, a 'class is not present in
model' warning for @generated classes would be nice to have :)
I don't know if it's easily implementable, though, since you'd need
access to the ecore model from which the code was generated...

On 27/11/10 21:01, Ed Merks wrote:
> Jeff,
>
> I wonder what kind of errors? When regenerating, unused imports aren't
> removed and in no case will entire files ever be deleted. So you likely
> need to do "Source->Organize Imports" and to delete files, if you've
> deleted EClasses.
>
>
> glenviewjeff wrote:
>> Thanks Ed. I don't seem to be having the same problems as before, so
>> this thread can probably be disregarded. There is only one minor
>> remaining issue.
>> If I delete a meta-model element using the default EMF/ecore editor
>> and re-generate the model, I do get errors in the generated src
>> directory (src-gen.) If I delete the src-gen directory and
>> re-generate, the errors disappear.
>>
>> Thanks,
>> Jeff
Previous Topic:How to disable copy, cut, paste, delete menu items for elements with specific property
Next Topic:[EMF Databinding] Editing objects in a dialog
Goto Forum:
  


Current Time: Thu Apr 25 15:11:21 GMT 2024

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

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

Back to the top