Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Eclipse platform URIs in command line(How to deal with Eclipse platform URIs in command line)
Eclipse platform URIs in command line [message #1863300] Wed, 24 January 2024 11:31 Go to next message
Eclipse UserFriend
Hello all,
I have a Xtex DSL where other DSLs are imported. I saw in one of the projects that a team is using Platform URIs for the imports. This breaks the command line (jar) execution for validation of DSLs as there is no concept of Platform URIs in the command line.

I am not sure how to tackle this issue and where should I look into.
Does it make sense to programmatically convert these URIs to something else during command line? Any help is highly appreciated.

My Import rule looks like below:

Import:
importURI=STRING ;


Re: Eclipse platform URIs in command line [message #1863304 is a reply to message #1863300] Wed, 24 January 2024 13:15 Go to previous messageGo to next message
Eclipse UserFriend
you may check what
https://github.com/eclipse/mwe/blob/3179e8fefb4abd6e2503ba74da80ca0e901343e3/plugins/org.eclipse.emf.mwe.utils/src/org/eclipse/emf/mwe/utils/StandaloneSetup.java#L444
does
Re: Eclipse platform URIs in command line [message #1863305 is a reply to message #1863304] Wed, 24 January 2024 17:26 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the reply. What is the place I should replace these platform URIs to some relative uris before they go to validation / generation etc? I tried use a custom URI handler but I do not get anything there. However I could change these Import URIS in the scoping part to set them to relative if it is non eclipse context. Do you think that is the right approach?
Re: Eclipse platform URIs in command line [message #1863307 is a reply to message #1863305] Thu, 25 January 2024 01:19 Go to previous messageGo to next message
Eclipse UserFriend
i dont know what you do in your standalone tool.
but before you load the models.
maybe you can look into the ImportUriResolver / ImportUriGlobalScopeProvider

[Updated on: Thu, 25 January 2024 07:56] by Moderator

Re: Eclipse platform URIs in command line [message #1863354 is a reply to message #1863307] Mon, 29 January 2024 05:42 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for your reply, Christian!
Is it generally considered a good idea to change the importURI value in scoping for command line execution ?
I see that there is a scoping class implemented based on ImportUriGlobalScopeProvider in my project and I can modify the importURIs to relative paths from platform URIs during command line execution.
Do you see any issues with this approach or it should be done somewhere else ?
Re: Eclipse platform URIs in command line [message #1863357 is a reply to message #1863354] Mon, 29 January 2024 06:30 Go to previous messageGo to next message
Eclipse UserFriend
no, if you fill the uri map properly
it will resolve

platform:/resource/xxxxxx/yyyy/zzzz.mydsl to the correct file
Re: Eclipse platform URIs in command line [message #1863376 is a reply to message #1863357] Tue, 30 January 2024 03:47 Go to previous messageGo to next message
Eclipse UserFriend
where do I get this URI map ? Could you give me some context/ example link on this ?

Re: Eclipse platform URIs in command line [message #1863391 is a reply to message #1863376] Wed, 31 January 2024 00:50 Go to previous message
Eclipse UserFriend
if i wound have an example i would have pointed you.
i also did not get any information on what you do in your command line tool.
i assume you need to decide therere that platform:/resource/xxx/yyyy/zzzz.mydsl is file:///x/y/z/yyyy/zzzz.mydsl

i already pointed you to standalonesetup. check what it does in
setScanClassPath
Previous Topic:Different indentation level in the same file
Next Topic:Rendering problem (?) in runtime Eclipse application
Goto Forum:
  


Current Time: Tue Jun 24 07:12:18 EDT 2025

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

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

Back to the top