Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Formatter2 xtend classes not converted to java on Linux
Formatter2 xtend classes not converted to java on Linux [message #1801251] Tue, 15 January 2019 20:30 Go to next message
ayman salah is currently offline ayman salahFriend
Messages: 130
Registered: June 2015
Senior Member
Hi all,

I have the following added to my mwe2:
formatter = {
  generateStub = true  
  generateXtendStub = true
}


I have 3 java classes and 2 xtend classes in the formatting2 package found under src.

When I run MWE2 workflow, I see the 2 xtend classes generated as java under xtend-gen folder formatting2 package.

This only happens on Windows while on Linux it doesn't generate the 2 java classes under xtend-gen. I can't figure out what's going on.

I am using Xtext 2.15.0.
Re: Formatter2 xtend classes not converted to java on Linux [message #1801254 is a reply to message #1801251] Tue, 15 January 2019 22:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
Which files do you get
Are you sure this is not a case insensitive problem
Can you share a minimal example


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Formatter2 xtend classes not converted to java on Linux [message #1801256 is a reply to message #1801254] Tue, 15 January 2019 22:08 Go to previous messageGo to next message
ayman salah is currently offline ayman salahFriend
Messages: 130
Registered: June 2015
Senior Member
formatting2 package has the following:
- DSLFormatterPreferenceKeys.java
- DSLFormatterPreferenceValuesProvider.java
- DSLFormattingUtils.java
- DSLFormatter.xtend
- DSLGenericFormatter.xtend

On windows xtend-gen formatting2 package contains:
- DSLFormatter.java
- DSLGenericFormatter.java

On Linux xtend-gen formatting2 package contains nothing.
No errors are shown during generation.

Can it be a permissions issue?
Case sensitivity, but how?

Note:
If in eclipse I open any of the xtend files and write anything then save the java file appears in xtend-gen folder.
Re: Formatter2 xtend classes not converted to java on Linux [message #1801257 is a reply to message #1801256] Tue, 15 January 2019 22:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
Please share a reproducible example. Try the same with a hello world project

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Formatter2 xtend classes not converted to java on Linux [message #1801258 is a reply to message #1801257] Tue, 15 January 2019 22:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
Besides that you can debug around TextFileAccess

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Formatter2 xtend classes not converted to java on Linux [message #1801259 is a reply to message #1801257] Tue, 15 January 2019 22:31 Go to previous messageGo to next message
ayman salah is currently offline ayman salahFriend
Messages: 130
Registered: June 2015
Senior Member
I am not able to reproduce it on some small project.
Re: Formatter2 xtend classes not converted to java on Linux [message #1801260 is a reply to message #1801259] Tue, 15 January 2019 22:31 Go to previous messageGo to next message
ayman salah is currently offline ayman salahFriend
Messages: 130
Registered: June 2015
Senior Member
I'll take a look at TextFileAccess and let you know. Thanks
Re: Formatter2 xtend classes not converted to java on Linux [message #1801465 is a reply to message #1801260] Sun, 20 January 2019 13:39 Go to previous messageGo to next message
ayman salah is currently offline ayman salahFriend
Messages: 130
Registered: June 2015
Senior Member
I was able to do it on DomainModel example.
Steps:
1. Create new xtext project using domain model project
2. Remove org.eclipse.xtext.example.domainmodel/src-gen/* and org.eclipse.xtext.example.domainmodel/xtend-gen/
3. Run the build command:
R:/jdk1.8.0_181_64/bin/javaw.exe -Xmx768m -Dfile.encoding=Cp1252 -classpath "D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.xtext_2.15.0.v20180916-0722.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.emf.ecore.xmi_2.12.0.v20160420-0247.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.emf.ecore_2.12.0.v20160420-0247.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.emf.common_2.12.0.v20160420-0247.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.antlr.runtime_3.2.0.v201101311130.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\com.google.inject_3.0.0.v201605172100.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.emf.mwe.core_1.3.20.v201605261103.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.apache.commons.cli_1.2.0.v201404270220.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.emf.mwe2.runtime_2.9.0.v201605261103.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.emf.mwe.utils_1.3.20.v201605261103.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.xtext.util_2.15.0.v20180916-0722.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\com.google.guava_15.0.0.v201403281430.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\javax.inject_1.0.0.v20091030.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.xtext.xbase_2.15.0.v20180916-1104.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.xtext.common.types_2.15.0.v20180916-1104.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.xtend.lib_2.15.0.v20180916-1130.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.xtext.xbase.lib_2.15.0.v20180916-1130.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.xtend.lib.macro_2.15.0.v20180916-1130.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.equinox.common_3.8.0.v20160509-1230.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.objectweb.asm_6.2.1.v20180823-1831.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.xtext.xtext.generator_2.15.0.v20180916-0722.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.emf.codegen.ecore_2.12.0.v20160526-0356.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.emf.codegen_2.11.0.v20160526-0356.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.emf.mwe2.launch_2.9.0.v201605261103.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.emf.mwe2.language_2.9.0.v201605261103.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.eclipse.emf.mwe2.lib_2.9.0.v201605261103.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.apache.commons.logging_1.2.0.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\org.apache.log4j_1.2.15.v201012070815.jar;D:\eclipse.platform.4.6.3\eclipse.xtext2.15.0\plugins\com.ibm.icu_56.1.0.v201601250100.jar;D:\eclipseWorkspace\org.eclipse.xtext.example.domainmodel\bin" org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher src/org/eclipse/xtext/example/domainmodel/GenerateDomainmodel.mwe2

4. You will find that xtend-gen contains nothing

Using eclipse build workspace creates the .java files under xtend-gen as expected. But the build command doesn't.
Re: Formatter2 xtend classes not converted to java on Linux [message #1801466 is a reply to message #1801465] Sun, 20 January 2019 13:41 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
i dont understand you. if you dont call the xtend generator xtend will not be generated. this is intended.
you need to call xtend-maven-plugin / gradle / ant / java to compile the xtend files to java


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Formatter2 xtend classes not converted to java on Linux [message #1801468 is a reply to message #1801466] Sun, 20 January 2019 14:18 Go to previous messageGo to next message
ayman salah is currently offline ayman salahFriend
Messages: 130
Registered: June 2015
Senior Member
I thought generate mwe2 includes the compilation of xtend files.

I am trying to figure out how to call the xtend compiler at the moment.

It keeps giving me errors because it can't find the Java classes.

Java compiler can't proceed due to failing to bind classes that are xtend.
Xtend compiler can't proceed due to not finding .class files generated by Java compiler.
Re: Formatter2 xtend classes not converted to java on Linux [message #1801471 is a reply to message #1801468] Sun, 20 January 2019 15:04 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
the xtend compiler does compile the java classes under the hood so it is working.
do you use maven or gradle?
or pure java?

org.eclipse.xtend.core.compiler.batch.Main


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Formatter2 xtend classes not converted to java on Linux [message #1801473 is a reply to message #1801471] Sun, 20 January 2019 16:44 Go to previous messageGo to next message
ayman salah is currently offline ayman salahFriend
Messages: 130
Registered: June 2015
Senior Member
I used ant called java with the Main you mentioned "org.eclipse.xtend.core.compiler.batch.Main".

My issue is that the -cp is too long..
Re: Formatter2 xtend classes not converted to java on Linux [message #1801474 is a reply to message #1801471] Sun, 20 January 2019 17:33 Go to previous messageGo to next message
ayman salah is currently offline ayman salahFriend
Messages: 130
Registered: June 2015
Senior Member
Christian Dietrich wrote on Sun, 20 January 2019 15:04
the xtend compiler does compile the java classes under the hood so it is working.


Okay I got it to work now. This was helpful http://xtextcasts.org/episodes/12-building-with-ant?autoplay=true
Re: Formatter2 xtend classes not converted to java on Linux [message #1801475 is a reply to message #1801473] Sun, 20 January 2019 17:35 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
hmmm have no idea on that.
what do you have on that path?
maybe copy all dependencies to a single dir with a short path


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Sun, 20 January 2019 17:36]

Report message to a moderator

Previous Topic:How to serialize XMI model to Xtext file
Next Topic:Access parent object in ProposalProvider even if parent is broken reference
Goto Forum:
  


Current Time: Mon Aug 26 01:03:30 GMT 2019

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

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

Back to the top