Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 16:31 Go to next message
Yusuf A is currently offline Yusuf AFriend
Messages: 9
Registered: April 2022
Junior Member
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 18:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14699
Registered: July 2009
Senior Member
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Eclipse platform URIs in command line [message #1863305 is a reply to message #1863304] Wed, 24 January 2024 22:26 Go to previous messageGo to next message
Yusuf A is currently offline Yusuf AFriend
Messages: 9
Registered: April 2022
Junior Member
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 06:19 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14699
Registered: July 2009
Senior Member
i dont know what you do in your standalone tool.
but before you load the models.
maybe you can look into the ImportUriResolver / ImportUriGlobalScopeProvider


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Thu, 25 January 2024 12:56]

Report message to a moderator

Re: Eclipse platform URIs in command line [message #1863354 is a reply to message #1863307] Mon, 29 January 2024 10:42 Go to previous messageGo to next message
Yusuf A is currently offline Yusuf AFriend
Messages: 9
Registered: April 2022
Junior Member
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 11:30 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14699
Registered: July 2009
Senior Member
no, if you fill the uri map properly
it will resolve

platform:/resource/xxxxxx/yyyy/zzzz.mydsl to the correct file


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Eclipse platform URIs in command line [message #1863376 is a reply to message #1863357] Tue, 30 January 2024 08:47 Go to previous messageGo to next message
Yusuf A is currently offline Yusuf AFriend
Messages: 9
Registered: April 2022
Junior Member
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 05:50 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14699
Registered: July 2009
Senior Member
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Different indentation level in the same file
Next Topic:Rendering problem (?) in runtime Eclipse application
Goto Forum:
  


Current Time: Wed Jul 24 13:01:31 GMT 2024

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

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

Back to the top