Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [SOLVED] What is the generated file ".File.dslbin"?
[SOLVED] What is the generated file ".File.dslbin"? [message #1758162] Fri, 24 March 2017 08:04 Go to next message
Stéphane Galland is currently offline Stéphane GallandFriend
Messages: 123
Registered: July 2014
Location: Belfort, France
Senior Member
With my DSL, several hidden files are generated. I have understood the meaning of the "*.java._trace" file.

But something I'm finding hidden files with the ".dslbin" (where "dsl" is the name of my dsl) file extension into the binary folder of my application coded with the DSL.

What is the purpose of this file?
Should I include it in the binary or source jar libraries that I want to create from my project?

I did not find any valuable information on Internet.

Thank you.
All the best.
Stéphane.

[Updated on: Fri, 31 March 2017 15:42]

Report message to a moderator

Re: What is the generated file ".File.dslbin"? [message #1758163 is a reply to message #1758162] Fri, 24 March 2017 08:13 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14076
Registered: July 2009
Senior Member
in you dsl you can decide to store a complete resource as binary for faster reading/accessing e.g. when the resource is needed as dependency during build.
this is does by ResourceStorageFacade.

=> it depends if you package you dsl files in a jar you should package the dslbin files as well.


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: What is the generated file ".File.dslbin"? [message #1758169 is a reply to message #1758163] Fri, 24 March 2017 08:37 Go to previous messageGo to next message
Stéphane Galland is currently offline Stéphane GallandFriend
Messages: 123
Registered: July 2014
Location: Belfort, France
Senior Member
Thank you Christian.
That's very clear now.
Re: What is the generated file ".File.dslbin"? [message #1758294 is a reply to message #1758169] Mon, 27 March 2017 09:53 Go to previous messageGo to next message
Stéphane Galland is currently offline Stéphane GallandFriend
Messages: 123
Registered: July 2014
Location: Belfort, France
Senior Member
Let the following files exist after my DSL compiler has ran:

  • src/mypackage/myscript.dsl
  • src-gen/mypackage/MyType.java
  • src-gen/mypackage/.MyType.java._trace
  • src-gen/mypackage/.myscript.dslbin
  • bin/mypackage/MyType.class


I want to create the binary and source Jar files. Am I right by putting the different files as:

  • In myprogram-1.0.jar:

    • mypackage/MyType.class

  • In myprogram-1.0-sources.jar:

    • mypackage/myscript.dsl
    • mypackage/MyType.java
    • mypackage/.MyType.java._trace
    • mypackage/.myscript.dslbin



Thank you.
Stéphane.
Re: What is the generated file ".File.dslbin"? [message #1758297 is a reply to message #1758294] Mon, 27 March 2017 11:02 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 83
Registered: January 2016
Location: Kiel
Member

Are you referencing any other elements from our dsl then the inferred JVMElements.
If not then I recommend to link to the *.class concepts in binaries.
The *.dslbin are merely an optimization for loading referenced resources in editors.
Re: What is the generated file ".File.dslbin"? [message #1758299 is a reply to message #1758297] Mon, 27 March 2017 11:29 Go to previous messageGo to next message
Stéphane Galland is currently offline Stéphane GallandFriend
Messages: 123
Registered: July 2014
Location: Belfort, France
Senior Member
The generated content from myscript.dsl, i.e. the MyType.java content does not have any reference to types outside the standard Java API.
The myprogram-1.0.jar library is supposed to be included into the classpath of a third party program.

Assuming that this third party program is also written in a Xtext-based editor, is it a good practice to put the ".dslbin" file into the binary archive and not in the source archive, in order to increase the speed of the Xtext-based editor? Assuming that the source archive is not be given to the editing environment.

Or, is the best practice to put the ".dslbin" file into the source archive, and "force" the third-party programmer to link the binary and source archives in its Eclipse IDE?

All the best.
Stéphane.
Re: What is the generated file ".File.dslbin"? [message #1758560 is a reply to message #1758299] Thu, 30 March 2017 07:04 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
The dslbin files only make sense as long as you're in a closed environment, like the workspace in which you're developing them. The Xtext builder will update them if necessary as you add remove resources.
You cannot tell what is in the workspace of someone using your jar, so it doesn't make sense to include them in the binary archive.

An example:
Your DSL model refers to something named Foo. The builder locates that Foo in your workspace and stores its URI in the dslbin.
When you change your workspace such that the reference must point to some other Foo (with regards to your scoping) then the builder detects that and updates the dslbin.
Next time an editor needs to you open your model it can be loaded from the binary representation, saving the time for initial parsing and linking.
When you use the same model from a binary jar in another workspace, you cannot predict which kinds of Foo are there, so your model has to be relinked entirely.
The .dslbin is of little use here.

What Sven means is that if you just link against JvmElements it doesn't matter as these have to be resolved against the classpath anyway. The dslbin does not store any other information than their fully qualified names.


---
Get professional support from the Xtext committers at www.typefox.io
Re: What is the generated file ".File.dslbin"? [message #1758680 is a reply to message #1758560] Fri, 31 March 2017 15:39 Go to previous message
Stéphane Galland is currently offline Stéphane GallandFriend
Messages: 123
Registered: July 2014
Location: Belfort, France
Senior Member
Thank you to both of you for your explanation.
I will update my building process accordingly.

All the best.
Stéphane.
Previous Topic:Question on ContentAssistProcessorTestBuilder#append
Next Topic:Hyperlink to external file
Goto Forum:
  


Current Time: Sat Oct 23 06:12:34 GMT 2021

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

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

Back to the top