Loading Xtext model without direct dependency to xtext plugin [message #1752656] |
Wed, 25 January 2017 20:34 |
Alexander Fichtinger Messages: 66 Registered: January 2013 |
Member |
|
|
Hey guys,
well, the title is already a little contradicting I think, but I'll try to explain our problem:
- We have an external developer who wants to write additional plug-ins for our application.
For these plug-ins he needs the Model of our language, so we put the whole model in an own plug-in (model is created with Xcore)
- Note that the .xtext-file and the other Xtext stuff (StandaloneSetup, Validator, Generator, , etc.) still is in another bundle.
Now we come to the part were it gets tricky. The external developer wants to test his plug-in. In order to do this he wants to load model files . But we don't want to provide him with the xtext plug-ins of our DSL.
Is there a way that he can load models without having a dependency to our plug-in containing the Xtext stuff, or should we try another concept to solve our problem?
I already found 2 solutions, but it seems like there always has to be the dependency to the plug-in which contains the .xtext file for the DSL:
Thanks for your help! =)
|
|
|
|
|
Re: Loading Xtext model without direct dependency to xtext plugin [message #1752700 is a reply to message #1752697] |
Thu, 26 January 2017 09:50 |
|
so you would give them no access to your languages at all?!?
this means that your extension points operate on an already loaded model ?!?
or should the development stuff and the production stuff work completely different,
which means "integration at the end user side ?!?"
if so why cannot create the developer of the third party plugins artifical xmi instances of the xcore himself and use these for their work ?!?
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: Loading Xtext model without direct dependency to xtext plugin [message #1752704 is a reply to message #1752700] |
Thu, 26 January 2017 11:53 |
Alexander Fichtinger Messages: 66 Registered: January 2013 |
Member |
|
|
Well, he gets access to the model, but not to the languages... =) That was the plan....
But this would be just the case for developing the unit tests. In our application of course the dsl plugins are included in order to load files with the corresponding extensions.
XMI instances would be a good alternative, but these also cannot be loaded from an dsl-file WITHOUT the dependency to the dsl plugin, can they?
The problem is, if they could not be loaded from a file, then the XMI instances have to be created programmatically, and this is no option, because our model is rather complicated...
I think we go with the option, that our client gets access to our dsl plugins..
Thanks for your great support! =)
|
|
|
|
|
Re: Loading Xtext model without direct dependency to xtext plugin [message #1753097 is a reply to message #1753094] |
Wed, 01 February 2017 20:07 |
|
no with indirect dependencies i mean:
(1) the dsls are in the target platform
(2) you don`t put a dependency to manifest
you do this (pseudo code)
public void doSomethingWith(IFile file) {
URI uri = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
IProject project = file.getProject();
IResourceServiceProvider rsp = IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(uri);
ResourceSet rs = rsp.get(IResourceSetProvider.class).get(project);
Resource r = rs.getResource(uri, true);
r.load(null);
...
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Powered by
FUDForum. Page generated in 0.03393 seconds