xtendbin files

250 views
Skip to first unread message

januar...@googlemail.com

unread,
Oct 28, 2016, 10:58:26 AM10/28/16
to Xtend Programming Language
What is the purpose of .xtendbin files?
Where can I learn more about them?
Are always created by the XtendBatchCompiler or is there an option to activate their generation?

Thanks your answers in advance!

Sven Efftinge (sven@efftinge.de)

unread,
Oct 28, 2016, 12:06:27 PM10/28/16
to xtend...@googlegroups.com
They are a binary serialization of the fully resolved state of an Xtend file. We use it in order to avoid unnecessary recomputation within the IDE.
They are generated by the Eclipse builder.

--
You received this message because you are subscribed to the Google Groups "Xtend Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xtend-lang+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

januar...@googlemail.com

unread,
Nov 8, 2016, 3:13:48 AM11/8/16
to Xtend Programming Language
Thanks for your explanation. Does the unit test TestBatchCompiler.testCompileTestDataWithStorage() imply that the latest XtendBatchCompiler also generates .xtendbin files?


Am Freitag, 28. Oktober 2016 18:06:27 UTC+2 schrieb Sven Efftinge:
They are a binary serialization of the fully resolved state of an Xtend file. We use it in order to avoid unnecessary recomputation within the IDE.
They are generated by the Eclipse builder.
2016-10-28 16:58 GMT+02:00 januarsimpson via Xtend Programming Language <xtend...@googlegroups.com>:
What is the purpose of .xtendbin files?
Where can I learn more about them?
Are always created by the XtendBatchCompiler or is there an option to activate their generation?

Thanks your answers in advance!

--
You received this message because you are subscribed to the Google Groups "Xtend Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xtend-lang+...@googlegroups.com.

Marc Oldenhof

unread,
Jun 17, 2019, 8:10:08 AM6/17/19
to Xtend Programming Language
I know this is an old thread, but it´s the only I can find about xtendbin files - and my JAR does not seem to function without them. Eclipse "Export to runnable jar" includes these files, and I´d like to generate them from the command line.

Can you tell me how the Eclipse Builder is called / where it is located?

best regards,
Marc


On Friday, October 28, 2016 at 6:06:27 PM UTC+2, Sven Efftinge wrote:
They are a binary serialization of the fully resolved state of an Xtend file. We use it in order to avoid unnecessary recomputation within the IDE.
They are generated by the Eclipse builder.
2016-10-28 16:58 GMT+02:00 januarsimpson via Xtend Programming Language <xtend...@googlegroups.com>:
What is the purpose of .xtendbin files?
Where can I learn more about them?
Are always created by the XtendBatchCompiler or is there an option to activate their generation?

Thanks your answers in advance!

--
You received this message because you are subscribed to the Google Groups "Xtend Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xtend...@googlegroups.com.

Christian Dietrich

unread,
Jun 18, 2019, 1:00:18 AM6/18/19
to Xtend Programming Language
the eclipse builder cannot be called from command line.
you can use the xtend maven or gradle plugins to build from command line.
what do you mean by "does not work without"
the xtendbin files should be completely optional.
=> can you give more details on what is not working?

Marc Oldenhof

unread,
Jun 18, 2019, 4:24:12 AM6/18/19
to Xtend Programming Language
 I have an XText 2.12 project (developing cut off from the internet, btw) consisting of 2 interconnected languages. Using some third-party libs, I want to create a generator to generate JSON from the DSL files. In Eclipse, I can create a runnable fat jar (Export - Java - Runnable JAR file) that works offline. It contains all necessary .class files plus all .xtendbin files.
Since we have an automatic building environment, I'm trying to create an Ant script to build this runnable JAR. It uses XtendCompilerAntTask to compile the xtend files (see build.xml snippet below). After compiling the resulting Java and packaging the dependency, the result is a runnable JAR that is exactly the same as the Eclipse-generated one, except for the .xtendbin files. This ANT-generated JAR does NOT work as a standalone generator, but produces a lot of errors, listed below.

The difference between the 2 jars is that the working one contains .xtendbin and ._trace files. Everything else seems to be the same, including the manifest (which has the same content in different order only).

Best regards,
Marc

Xtend compilation:
------------------
            <taskdef name="xtend.compiler" classname="org.eclipse.xtend.core.compiler.batch.XtendCompilerAntTask" classpathref="@{classpathref}" />
            <xtend.compiler destdir="xtend-gen" classpathref="@{classpathref}" failonerror="true">
                <srcdir path="src" />
                <srcdir path="src-gen/" />
            </xtend.compiler>

Console output:
---------------
0    ERROR AntlrTokenDefProvider - java.lang.NullPointerException
java.lang.NullPointerException
    at java.io.Reader.<init>(Reader.java:78)
    at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
    at org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.createReader(AntlrTokenDefProvider.java:97)
    at org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.getTokenDefMap(AntlrTokenDefProvider.java:48)
    at org.eclipse.xtext.parser.antlr.XtextTokenStream.<init>(XtextTokenStream.java:51)
    at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.createTokenStream(AbstractAntlrParser.java:161)
    at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(AbstractAntlrParser.java:89)
    at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.parse(AbstractAntlrParser.java:84)
    at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(AbstractAntlrParser.java:62)
    at org.eclipse.xtext.parser.AbstractParser.parse(AbstractParser.java:33)
    at org.eclipse.xtext.resource.XtextResource.doLoad(XtextResource.java:176)
    at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLoad(LazyLinkingResource.java:100)
    at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
    at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
    at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:265)
    at org.eclipse.xtext.resource.SynchronizedXtextResourceSet.getResource(SynchronizedXtextResourceSet.java:25)
    at org.inaetics.dsl.component.generator.Main.loadResources(Main.java:104)
    at org.inaetics.dsl.component.generator.Main.runGenerator(Main.java:61)
    at org.inaetics.dsl.component.generator.Main.main(Main.java:40)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.NullPointerException
    at org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.getTokenDefMap(AntlrTokenDefProvider.java:77)
    at org.eclipse.xtext.parser.antlr.XtextTokenStream.<init>(XtextTokenStream.java:51)
    at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.createTokenStream(AbstractAntlrParser.java:161)
    at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(AbstractAntlrParser.java:89)
    at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.parse(AbstractAntlrParser.java:84)
    at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(AbstractAntlrParser.java:62)
    at org.eclipse.xtext.parser.AbstractParser.parse(AbstractParser.java:33)
    at org.eclipse.xtext.resource.XtextResource.doLoad(XtextResource.java:176)
    at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLoad(LazyLinkingResource.java:100)
    at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
    at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
    at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:265)
    at org.eclipse.xtext.resource.SynchronizedXtextResourceSet.getResource(SynchronizedXtextResourceSet.java:25)
    at org.inaetics.dsl.component.generator.Main.loadResources(Main.java:104)
    at org.inaetics.dsl.component.generator.Main.runGenerator(Main.java:61)
    at org.inaetics.dsl.component.generator.Main.main(Main.java:40)
    ... 5 more

Christian Dietrich

unread,
Jun 18, 2019, 4:56:30 AM6/18/19
to Xtend Programming Language
this looks like the tokens file is missing (maybe xtextbin too, not xtend
=> what do you package to your jar?

Marc Oldenhof

unread,
Jun 18, 2019, 4:59:30 AM6/18/19
to Xtend Programming Language
Update: I forgot to check the file sizes for the generated .class files -- they are different between the working and non-working version.

What is interesting, however: if I do the following:

1) generate the runnable JAR from Eclipse
2) generate from ANT without cleaning (thus including the .xtendbin files already present)

then *both JARs work*.

Even more interesting: if I remove all .xtendbin files from BOTH jars, jar (1) still works, but jar (2) fails with injection messages ("Couldn't find resource on classpath. URI was 'classpath:/org/inaetics/dsl/component/Component.xmi'"). As I understand, xtendbin is a replacement for older .xmi data (?).

The .class file sizes in jar (2) are exactly the same as the ones generated in the previous test (generated by ANT from a clean workspace without xtendbin files).

It almost looks like the classes in jar (2) still expect some extra data from xmi or xtendbin, but the classes in jar (1) are "self-reliant". Any ideas?

Marc

Marc Oldenhof

unread,
Jun 18, 2019, 5:07:02 AM6/18/19
to Xtend Programming Language
What's a tokens file? (I'm a C++ programmer thrown headlong into this stuff -  my only Java experience up to now was some Android programming)

As I said, I package everything that Eclipse also packages except for the .xtendbin and ._trace files (if the workspace is clean, that is -- see update post)

Thanks a lot for the quick reactions!

Christian Dietrich

unread,
Jun 18, 2019, 5:07:53 AM6/18/19
to Xtend Programming Language
again: be very very careful

xtextbin is needed

xtendbin not

xtextbin != xtendbin

Marc Oldenhof

unread,
Jun 18, 2019, 5:12:12 AM6/18/19
to Xtend Programming Language
Yes, I figured that out before. (took me a while to see the difference - sorry, I also missed it in your post, I thought you said "xtendbin, not xtend"). The xtextbin file IS generated correctly by my ANT script.
Message has been deleted

Marc Oldenhof

unread,
Jun 18, 2019, 5:27:21 AM6/18/19
to Xtend Programming Language
It appears that I DID delete xtextbin from the jar in that last experiment. If I only delete xtendbin, the JAR still works. My apologies for wasting your time.

So, I'm still missing something else, I'll have to look further. Thank you for trying to help me out!

Marc
Reply all
Reply to author
Forward
0 new messages