Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Standalone executable with multiple DSLs(Standalone executable with multiple DSLs)
Standalone executable with multiple DSLs [message #1753885] Sat, 11 February 2017 18:04 Go to next message
Abhishek Dubey is currently offline Abhishek DubeyFriend
Messages: 10
Registered: July 2015
Junior Member
Hi all,

I have a project where there are 3 grammars: Datatypes, APP, and System. The App cross references entries from datatypes and System cross references entries from APP.

I am trying to create a standalone generated for System Models. Based on available information, I have called the 3 standalone setups. Then I am passing all the related models (for all of the 3 grammars) into the main file. And I am loading them using injectors specific to the grammar.

For example

injectsystem = new SystemStandaloneSetup().createInjectorAndDoEMFRegistration()
injectapp = new AppStandaloneSetup().createInjectorAndDoEMFRegistration()
injectdata= new AppStandaloneSetup().createInjectorAndDoEMFRegistration()

.... and

var resourceSetSystem= injectsystem .getInstance(typeof(XtextResourceSet))
var resourceSetApp = injectapp .getInstance(typeof(XtextResourceSet))
var resourceSetData = injectdata.getInstance(typeof(XtextResourceSet))
...

then
for (arg : args) {

... do some processing to get ext (extension)
if(ext=="sys")
{
resourceSetSystem.getResource(URI.createFileURI(arg), true)

}
else if (ext=="app")
{
resourceSetApp .getResource(URI.createFileURI(arg), true)
}
else if (ext=="dt")
{
resourceSetData .getResource(URI.createFileURI(arg), true)
}
}

However, when I try to run the validator on the system model it gives me errors that the references cannot be resolved. I think I understand why it is happening. However, I am not sure how to resolve the references across the three resourcesets in the standalone mode.

Thanks for your help.
Re: Standalone executable with multiple DSLs [message #1753886 is a reply to message #1753885] Sat, 11 February 2017 18:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
Simply use just one resourceset

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Standalone executable with multiple DSLs [message #1753887 is a reply to message #1753886] Sat, 11 February 2017 18:09 Go to previous messageGo to next message
Abhishek Dubey is currently offline Abhishek DubeyFriend
Messages: 10
Registered: July 2015
Junior Member
Thanks. Sorry I am not that familiar with the APIs. therefore, Just a clarification. I think I still need to call the three standalone setup

injectsystem = new SystemStandaloneSetup().createInjectorAndDoEMFRegistration()
injectapp = new AppStandaloneSetup().createInjectorAndDoEMFRegistration()
injectdata= new AppStandaloneSetup().createInjectorAndDoEMFRegistration()


Then should I add all of the files to the resourceSetSystem, which I am creating as follows

var resourceSetSystem= injectsystem .getInstance(typeof(XtextResourceSet))
Re: Standalone executable with multiple DSLs [message #1753888 is a reply to message #1753887] Sat, 11 February 2017 18:18 Go to previous messageGo to next message
Abhishek Dubey is currently offline Abhishek DubeyFriend
Messages: 10
Registered: July 2015
Junior Member
Thanks I resolved it.

Now there is just one more error

1 [main] ERROR xt.validation.ResourceValidatorImpl - The string resource '_UI_DiagnosticRoot_diagnostic' could not be located
java.util.MissingResourceException: The string resource '_UI_DiagnosticRoot_diagnostic' could not be located

I think that this a missing properties file. i found some conversation on google regarding this. i will try and resolve it.

Thanks for your help
Re: Standalone executable with multiple DSLs [message #1753891 is a reply to message #1753888] Sat, 11 February 2017 19:48 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
the problem might be the way you create the executable jar file.
there are multiple plugin.properties files that overide each other

=> you have to merge them
=> or use something like the gradle application plugin (that created a java ap with -classpath, so the plugin.properties will not be merged
=> maybe there are options to do this on maven as well


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Previous Topic:How to deresolve a URI
Next Topic:dsl maven build cannot resolve types defined in xtend
Goto Forum:
  


Current Time: Fri Nov 08 19:35:10 GMT 2024

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

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

Back to the top