Skip to main content



      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 11:33 Go to next message
Eclipse UserFriend
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 17:38 Go to previous messageGo to next message
Eclipse UserFriend
How do you distinguish the projects? Maybe you can implement canHandle in
your resourceserviceprovider or resourceuiserviceprovider
Re: Disable language support for project [message #1724125 is a reply to message #1724030] Sun, 21 February 2016 08:51 Go to previous messageGo to next message
Eclipse UserFriend
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 08:57 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Disable language support for project [message #1724127 is a reply to message #1724126] Sun, 21 February 2016 09:00 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Disable language support for project [message #1724129 is a reply to message #1724126] Sun, 21 February 2016 09:46 Go to previous messageGo to next message
Eclipse UserFriend
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 10:52 Go to previous message
Eclipse UserFriend
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: Sun Jul 27 14:42:16 EDT 2025

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

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

Back to the top