Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350692 - MWE2 EcoreGeneratorFragment referencedGenModels might be inferred from grammar imports
Summary: MWE2 EcoreGeneratorFragment referencedGenModels might be inferred from gramma...
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-29 08:01 EDT by Dietmar Stoll CLA
Modified: 2017-09-19 18:14 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dietmar Stoll CLA 2011-06-29 08:01:40 EDT
Build Identifier: 

A great enhancement would be a mechanism which infers (or suggests or warns about) the referenced genmodels in the
MWE workflow fragment "ecore.EcoreGeneratorFragment"

Example in the *.xtext Grammar:

import "platform:/resource/myDir/MyReferencedDsl.ecore" as myRefDsl
import "platform:/resource/projectname/directory/MyOtherDsl.ecore" as myOtherRefDsl

If these imports are present, usually one wants to have the following referencedGenModels part in the workflow (*.mwe2 file):

fragment = ecore.EcoreGeneratorFragment {
referencedGenModels = "platform:/resource/myDir/MyReferencedDsl.genmodel,
platform:/resource/projectname/directory/MyOtherDsl.genmodel" }

The entries in the workflow file could be inferred, or a quick fix suggestion in the xtext grammar could be made.

Reproducible: Always
Comment 1 Jan Koehnlein CLA 2011-06-29 08:43:19 EDT
Unfortunately, the genmodel could reside in a completely different location. It does not necessarily be in the same directory as the ecore file.

EcoreGeneratorFragment.referencedGenModels is deprecated. Please use the StandaloneSetup.registerGenModelFile property which is a list.
Comment 2 Dietmar Stoll CLA 2011-06-29 10:13:12 EDT
True, a quick fix could only use a heuristic. Maybe it is not worth the effort.
Comment 3 Moritz Eysholdt CLA 2011-07-11 03:55:02 EDT
This inference is already working with Xtext 2.0... however, the referenced GenModels are determined based on which EPackages are referenced from the main EPacakge (and not based on the grammar's imports).

See EcoreGeneratorFragment.getReferencedEPackages(List<EPackage>)

As Jan already pointed out, GenModels for referenced EPackage can be found since they are expected to have been registered with StandaloneSetup.addRegisterGenModelFile(String)
Comment 4 Karsten Thoms CLA 2017-09-19 18:04:58 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 18:14:56 EDT
Closing all bugs that were set to RESOLVED before Neon.0