Skip to main content



      Home
Home » Modeling » TMF (Xtext) » How to exclude resources from build(How to exclude jar resources which are not used for global scoping from build?)
How to exclude resources from build [message #1766777] Tue, 27 June 2017 04:42 Go to next message
Eclipse UserFriend
Hello,
I am trying to speed up my xbase language, and I have learned a lot of Scoping, Containers, Linking, ..., but I was not successful to speed up my language in a way my colleagues would like to work with it. The performance slows down when language files are increasing, so a full build takes 15 sec if only one project is open (normally we have 6-7 projects open -> this is more than a minute).
Now I dug a bit and found that files in jars are parsed, no problem as they might be needed for global linking, but these resources are not only parsed but passed to EcoreUtil2.resolveLazyCrossReferences in Step 6 of ClusteringBuilderState. This causes the resource to be parsed again and the linking takes most of the time. Now the problem is, that 90% of these files are not used for global scoping, only the generated classes are referenced, an they are already included in the jar file.
I have created my own ResourceDescriptionStrategy to make sure that no EObjectDescription is created, but this has no effect.

My guess would be to create my own ClusteringBuilderState, but I doubt that this is the right solution.

So my question is: Is there a better way how to exclude resources, which are not used in global scoping?

Any hint welcome.
I am still using xtext 2.9.2.
Thank you
Re: How to exclude resources from build [message #1766779 is a reply to message #1766777] Tue, 27 June 2017 05:06 Go to previous messageGo to next message
Eclipse UserFriend
The naive way:

org.eclipse.xtext.resource.IResourceServiceProvider.canHandle(URI)
org.eclipse.xtext.ui.resource.IResourceUIServiceProvider.canHandle(URI, IStorage)

is not working for you
Re: How to exclude resources from build [message #1766781 is a reply to message #1766779] Tue, 27 June 2017 05:24 Go to previous messageGo to next message
Eclipse UserFriend
Thank's for quick answer, but I don't think so, as I need to read the content, to decide if it is used for global scoping or not.
Re: How to exclude resources from build [message #1766782 is a reply to message #1766781] Tue, 27 June 2017 05:25 Go to previous messageGo to next message
Eclipse UserFriend
what do you mean by "read content"
Re: How to exclude resources from build [message #1766783 is a reply to message #1766782] Tue, 27 June 2017 05:33 Go to previous messageGo to next message
Eclipse UserFriend
I have to parse file and according to the defined types I can decide.
Re: How to exclude resources from build [message #1766786 is a reply to message #1766783] Tue, 27 June 2017 05:59 Go to previous messageGo to next message
Eclipse UserFriend
Don't get that. You want to parse files to avoid building them?
Re: How to exclude resources from build [message #1766787 is a reply to message #1766783] Tue, 27 June 2017 06:02 Go to previous messageGo to next message
Eclipse UserFriend
Hi

For OCL, I achieved significant speedups by refactoring the projects so that my generated projects, including Xtext parsers and UI support, omitted all the build functionality which was moved to a separate build plugin that is not needed at run-time. 'speedups'; more likely I avoided some of the horrendous build loops. Minimize the dependencies/contents of the useful plugins.

The original design of the Eclipse builder supported the auto-build of Java projects whose dependencies form a tree which PDE discovers and so does sensible incremental builds. However once you have auto-generated Java, perhaps from JET, perhaps from Xtend, it is easy for dependency cycles to form. Think very carefully about your plugin hierarchy to avoid these cycles otherwise you may sometimes wait much much longer than 15 seconds for the mess to stabilize.

Regards

Ed Willink
Re: How to exclude resources from build [message #1766789 is a reply to message #1766787] Tue, 27 June 2017 06:23 Go to previous messageGo to next message
Eclipse UserFriend
@Christian. I do not want to generate anything from them, as the generated classes are already included in the jar file, but some files contain models which are referenced globally and, as I understood, only these files have to be parsed and linked.
@Ed: Thanks, and Sorry but this is too much for me, but I will try to have a look a OCL, maybe this will help.
Re: How to exclude resources from build [message #1766792 is a reply to message #1766789] Tue, 27 June 2017 06:35 Go to previous message
Eclipse UserFriend
hmm for generation have a look at IShouldGenerate
Previous Topic:IncrementalBuild loop in XText 2.11
Next Topic:Explanation of Binding in layman terms?
Goto Forum:
  


Current Time: Sat Nov 08 16:58:37 EST 2025

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

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

Back to the top