Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Generated ecore models refer to Xbase using relative paths
Generated ecore models refer to Xbase using relative paths [message #1016175] Tue, 05 March 2013 11:00 Go to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 222
Registered: July 2009
Senior Member
Hi,

the EMF-IncQuery project recently received a bug report (https://bugs.eclipse.org/bugs/show_bug.cgi?id=401552) that the generated ecore models contain references with strange relative paths such as the following:

eType="ecore:EClass ../../../../../../../org.eclipse.xtext.xbase/model/Xbase.ecore#//XExpression"


All examples contain references to referenced Xbase elements. I have experimented with various mwe settings as suggested in various forum posts, but could not find a way to replace those relative urls with absolute ones.

Is there a way I missed to generate the ecore models with either platform:/plugin style url (I know about the Eclipse platform dependency that way) or EPackage nsUri based urls, or I have to replace the EMF model with a manually created one?

Thanks,
Zoltán
Re: Generated ecore models refer to Xbase using relative paths [message #1044855 is a reply to message #1016175] Fri, 19 April 2013 12:22 Go to previous messageGo to next message
Carlo M-R is currently offline Carlo M-RFriend
Messages: 5
Registered: June 2011
Junior Member
Hi,

i'm facing the similar problem when moving one of our dsls into a totally different folder structure it seems to fail due to these relatives pathes found in the .ecore files.

Did you find any hint/solution on how to replace these pathes?


Greets,
Carlo
Re: Generated ecore models refer to Xbase using relative paths [message #1044972 is a reply to message #1044855] Fri, 19 April 2013 15:22 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 222
Registered: July 2009
Senior Member
Hi,

Sadly, I have really no idea how to solve this. I am thinking about customizing the workflow, but I have no idea if it is possible to register e.g. an EMF URIHandler to the Xtext generator process.

If I have a solution, I will post it here, but nothing tangible yet.

Cheers,
Zoltán
Re: Generated ecore models refer to Xbase using relative paths [message #1049989 is a reply to message #1044972] Fri, 26 April 2013 14:54 Go to previous messageGo to next message
Carlo M-R is currently offline Carlo M-RFriend
Messages: 5
Registered: June 2011
Junior Member
Hi,

i added an URI Mapping to the mwe-Workflow of the using project

uriMap = {
from ="../../../../../../../../"
to = "platform:/resource/"
}

This seems to do the trick.

Greets,
Carlo
Re: Generated ecore models refer to Xbase using relative paths [message #1243909 is a reply to message #1016175] Tue, 11 February 2014 16:23 Go to previous message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 222
Registered: July 2009
Senior Member
Hi,

The uri mapping approach as suggested by Carlo M-R in the latest post did not work for me in Xtext 2.4.3.

However, I found out what is causing this issue in general: the EMFGenerator defines a static internal class called 'ToPlatformResourceDeresolvingURIHandler' that extends the 'PlatformSchemeAware' uri handler that creates cross-project relative references.

I have created an updated version of this generator in EMF-IncQuery, that replaces the URIHandler to extend the 'AbsoluteCrossBundleAware' uri handler class.

The corresponding change can be found in the following commit: http://git.eclipse.org/c/incquery/org.eclipse.incquery.git/commit/?id=e0fe2bc02d4adf8df6779132bff5595a543bf037

Cheers,
Zoltán
Previous Topic:Custom Code Overridden - Generator Model
Next Topic:correct reference problem with import statement and unti-test
Goto Forum:
  


Current Time: Sun Nov 23 19:14:26 GMT 2014

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

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