Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Disable language support for project(How to disable language support for one project only)
Disable language support for project [message #1724003] Fri, 19 February 2016 16:33 Go to next message
Peter Luthardt is currently offline Peter LuthardtFriend
Messages: 43
Registered: February 2014
Member
I use three different languages. My project consists of different modules (each an eclipse project).
One project, which does some configuration and depends on all the others, but uses only one language.
Now I want to disable the 2 other languages for this module.
I tried to disable the compiler for the project, but the chunks of the other languages are still loaded, when I run a clean build. This cost quite a lot of time as all the CrossRefernces are resolved.
In ClusteringBuilderState I found the doUpdate takes very long because of EcoreUtil2.resolveLazyCrossReferences(resource, cancelMonitor);
This is done for files which do not belong to the used language.

Thanks
Re: Disable language support for project [message #1724030 is a reply to message #1724003] Fri, 19 February 2016 22:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14398
Registered: July 2009
Senior Member
How do you distinguish the projects? Maybe you can implement canHandle in
your resourceserviceprovider or resourceuiserviceprovider


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: Disable language support for project [message #1724125 is a reply to message #1724030] Sun, 21 February 2016 13:51 Go to previous messageGo to next message
Peter Luthardt is currently offline Peter LuthardtFriend
Messages: 43
Registered: February 2014
Member
The projects could be identified, by
- no language file is in the source or
- compiler of the language is disabled or
- I could create some configuration file which triggers the language.
- ...(other ideas welcome)

Could you please give me some more inforation how to override the resourceServiceProviders.
Thanks
Re: Disable language support for project [message #1724126 is a reply to message #1724030] Sun, 21 February 2016 13:57 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
I don't quite get it yet.

1) There is only one single builder for all Xtext languages, so no such thing as a "used language" from the builder's perspective.
2) What is the difference between "depending on" another language and "using" it?
3) The auto-builder runs for changed resources only. Have you disabled "Build automatically"? May not be a good idea to do only full builds if you're they are slow.
4) The builder only resolves cross-references directly from changed files, but not transitively. This is necessary and shouldn't be disabled.
5) As long as a project does not contain any resource of a given language, it will not build it.


---
Get professional support from the Xtext committers at www.typefox.io
Re: Disable language support for project [message #1724127 is a reply to message #1724126] Sun, 21 February 2016 14:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14398
Registered: July 2009
Senior Member
i asume you have files in that project that you do not want to read/index/reference.
i proposed to override org.eclipse.xtext.resource.impl.DefaultResourceServiceProvider.canHandle(URI)
and add a binding for IResourceServiceProvider in the runtime module


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: Disable language support for project [message #1724129 is a reply to message #1724126] Sun, 21 February 2016 14:46 Go to previous messageGo to next message
Peter Luthardt is currently offline Peter LuthardtFriend
Messages: 43
Registered: February 2014
Member
Jan Koehnlein wrote on Sun, 21 February 2016 08:57
I don't quite get it yet.

1) There is only one single builder for all Xtext languages, so no such thing as a "used language" from the builder's perspective.
2) What is the difference between "depending on" another language and "using" it?
3) The auto-builder runs for changed resources only. Have you disabled "Build automatically"? May not be a good idea to do only full builds if you're they are slow.
4) The builder only resolves cross-references directly from changed files, but not transitively. This is necessary and shouldn't be disabled.
5) As long as a project does not contain any resource of a given language, it will not build it.


1.) Thanks for clarification
2.) The languages only uses the generated java classes of the other language. So there is no direct dependency on language level. If project A depends on project B, but does not uses the language used in project B, but only the generated java classes. (The bad thing is that project C depends on A and needs to have access to model of project B. I thought of creating two artifacts one java.jar and one model.jar, so each project can decide if it needs the model ore not.)
3.) I have to run a full build quite often, as I have an ugly structure, that I have to create some build script which needs to read the whole model and this is not triggered when I change one file of the model.
5.) This is not my experience. When the project contains resources in the class path, which do not belong to sources of the project, than these resources are loaded when I run a full build.
Re: Disable language support for project [message #1724134 is a reply to message #1724127] Sun, 21 February 2016 15:52 Go to previous message
Peter Luthardt is currently offline Peter LuthardtFriend
Messages: 43
Registered: February 2014
Member
Christian Dietrich wrote on Sun, 21 February 2016 09:00
i asume you have files in that project that you do not want to read/index/reference.
i proposed to override org.eclipse.xtext.resource.impl.DefaultResourceServiceProvider.canHandle(URI)
and add a binding for IResourceServiceProvider in the runtime module


Yes I guess this would do the trick, but how can I access the currently build project?, to read some control file or better how can I read the compile flag?
Previous Topic:Custom Content Assist in Xtext
Next Topic:DSL with XText for PlantUML class diagrams
Goto Forum:
  


Current Time: Wed Dec 07 20:07:06 GMT 2022

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

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

Back to the top