Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Multiple xtext DSL projects in one workspace
Multiple xtext DSL projects in one workspace [message #1842198] Fri, 11 June 2021 13:43 Go to next message
Juewei Jin is currently offline Juewei JinFriend
Messages: 17
Registered: July 2009
Junior Member
In the Java world, we can add multiple Java maven projects in one Eclipse workspace, and define the dependencies between them in the pom.xml file.
Is it possible to do this similarly for xtext DSL project too?

I got this idea is because our xtext DSL projects getting bigger and bigger. What we are doing now is under the root folder created many sub folders and put our DSLs in corresponding sub folders. The DSL models in different sub folders have dependencies between them. Now the build time takes too long. We are thinking about to divide the single DSL project into multiple sub projects. I know it is possible to add multiple projects in one workspace, when they are independent to each other. Is it possible to add multiple projects in one workspace, which are dependent to each other?
Re: Multiple xtext DSL projects in one workspace [message #1842199 is a reply to message #1842198] Fri, 11 June 2021 13:45 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14026
Registered: July 2009
Senior Member
hi, this works out of the box. simply use either project references or like in maven have java projects with dependencies to each other

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Multiple xtext DSL projects in one workspace [message #1842215 is a reply to message #1842199] Sat, 12 June 2021 06:35 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7220
Registered: July 2009
Senior Member
Hi

With multiple DSLs, you may find it helpful to refactor all the build support (*.mwe2) into a separate plugin so that your DSL plugins have significantly reduced dependencies.

See the one https://git.eclipse.org/r/plugins/gitiles/ocl/org.eclipse.ocl/+/refs/heads/master/examples/org.eclipse.ocl.examples.build/
and five variants of https://git.eclipse.org/r/plugins/gitiles/ocl/org.eclipse.ocl/+/refs/heads/master/plugins/org.eclipse.ocl.xtext.oclinecore/
for an example.

Regards

Ed Willink
Re: Multiple xtext DSL projects in one workspace [message #1842488 is a reply to message #1842199] Mon, 21 June 2021 15:25 Go to previous messageGo to next message
Juewei Jin is currently offline Juewei JinFriend
Messages: 17
Registered: July 2009
Junior Member
hi Christian,
thanks for your suggestion.
we need to save the dependencies in Git, so that all users can share the dependencies between DSL model projects. (Here not the DSL language projects, but the DSL artifact/model projects, which contains the DSL models using the DSL language.)
With the first option using "project references ", the dependencies are saved in eclipse workspace. I think it is difficult to share the dependencies with other users. If I'm wrong, please correct me.
With the second option "like in maven have java projects with dependencies to each other", I don't understand what exactly do you mean. Do you mean that we can create maven project and use pom.xml to save the dependencies between DSL projects?

[Updated on: Mon, 21 June 2021 15:41]

Report message to a moderator

Re: Multiple xtext DSL projects in one workspace [message #1842493 is a reply to message #1842488] Mon, 21 June 2021 16:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14026
Registered: July 2009
Senior Member
yes. the same as you would to with java code and maven.

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Multiple xtext DSL projects in one workspace [message #1842697 is a reply to message #1842493] Tue, 29 June 2021 10:00 Go to previous messageGo to next message
Juewei Jin is currently offline Juewei JinFriend
Messages: 17
Registered: July 2009
Junior Member
Hi Christian,
I tried both ways, using the project reference and using maven pom.xml to define the DSL model project dependencies. Both of them works fine within eclipse.
But it seems that the standalone mode supports neither of them.
For example, I have DSL model project A and B, where the project B depends on project A. When I use standalone mode to run project B, it could not find the models in project A.
Do I need to do additional steps for the standalone mode?
Re: Multiple xtext DSL projects in one workspace [message #1842701 is a reply to message #1842697] Tue, 29 June 2021 11:06 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14026
Registered: July 2009
Senior Member
what do you mean by standalone support /mode?
if you read files by hand, then of course you have to do this by hand as well.
you may check how the lsp impl deal with projects


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Recursive Grammar with EMF
Next Topic:How to make the LSP server print more debug logs?
Goto Forum:
  


Current Time: Thu Jul 29 00:14:04 GMT 2021

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

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

Back to the top