Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Upgrading Xtext/Xtend Versions(Upgrading an old ant build project from Java 8/Xtext 2.7.3/Xtend 2.2 to Java 11/Xtext 2.32/Xtend 2.32)
Upgrading Xtext/Xtend Versions [message #1863505] Tue, 06 February 2024 22:31 Go to next message
Nick Perez is currently offline Nick PerezFriend
Messages: 7
Registered: February 2024
Junior Member
I've updated all the Eclipse/Xtext/Xtend dependencies.

The ant build first generates xtext artifacts. I've successfully edited the mwe2 workflow to create xtext generated class files.

The next compile-xtend part of the build gives me errors in an xtend file. Could there be a new xtend syntax I'm unware of that for some reason xtend.core is not seeing the interface created by xtext?

compile-xtend:
[java] 0 WARN XtendBatchCompiler - Compilation of stubs had errors.
[java] 0 [main] WARN org.eclipse.xtend.core.compiler.batch.XtendBatchCompiler - Compilation of stubs had errors.
[java] 1293 ERROR XtendBatchCompiler -
[java] ERROR: TaskModelGenerator.xtend - task_type_editor/generator/TaskModelGenerator.xtend
[java] 1046: The method getName is undefined for the type Object
[java] 1293 [main] ERROR org.eclipse.xtend.core.compiler.batch.XtendBatchCompiler -
[java] ERROR: TaskModelGenerator.xtend - task_type_editor/generator/TaskModelGenerator.xtend
[java] 1046: The method getName is undefined for the type Object
[java] 1293 ERROR XtendBatchCompiler -
[java] ERROR: TaskModelGenerator.xtend - task_type_editor/generator/TaskModelGenerator.xtend
[java] 1049: The method or field name is undefined for the type Object
[java] 1293 [main] ERROR org.eclipse.xtend.core.compiler.batch.XtendBatchCompiler -
[java] ERROR: TaskModelGenerator.xtend - task_type_editor/generator/TaskModelGenerator.xtend
[java] 1049: The method or field name is undefined for the type Object
[java] 1293 ERROR XtendBatchCompiler -
[java] ERROR: TaskModelGenerator.xtend - task_type_editor/generator/TaskModelGenerator.xtend
[java] 1217: The method or field name is undefined for the type Object
[java] 1293 [main] ERROR org.eclipse.xtend.core.compiler.batch.XtendBatchCompiler -
[java] ERROR: TaskModelGenerator.xtend - task_type_editor/generator/TaskModelGenerator.xtend
[java] 1217: The method or field name is undefined for the type Object
[java] 1293 ERROR XtendBatchCompiler -
[java] ERROR: TaskModelGenerator.xtend - task_type_editor/generator/TaskModelGenerator.xtend
[java] 1221: The method or field getModifier is undefined for the type Object
[java] 1293 [main] ERROR org.eclipse.xtend.core.compiler.batch.XtendBatchCompiler -
[java] ERROR: TaskModelGenerator.xtend - task_type_editor/generator/TaskModelGenerator.xtend
[java] 1221: The method or field getModifier is undefined for the type Object
[java] 1293 ERROR XtendBatchCompiler -
Re: Upgrading Xtext/Xtend Versions [message #1863509 is a reply to message #1863505] Wed, 07 February 2024 04:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14695
Registered: July 2009
Senior Member
Can you give more details,
This looks like a java version problem
Or wrong asm version problem


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Wed, 07 February 2024 04:51]

Report message to a moderator

Re: Upgrading Xtext/Xtend Versions [message #1863520 is a reply to message #1863505] Wed, 07 February 2024 14:11 Go to previous messageGo to next message
Nick Perez is currently offline Nick PerezFriend
Messages: 7
Registered: February 2024
Junior Member
Thanks for the quick reply.

java -version
openjdk version "11.0.14.1" 2022-02-08 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.14.1+1-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.14.1+1-LTS, mixed mode, sharing)

ant -version
Apache Ant version 1.8.0 compiled on February 1 2010

I've also included a file with all the dependencies buckminster initially copies to a /tmp directory and ant adds to its Java classpath.

In the .xtend file that is giving compile errors, the errors have to do with interfaces generated by xtext mwe2 workflow.
For example: [java] 1046: The method getName is undefined for the type Object. The xtext generated 'public interface Feature extends EObject' contains a method 'String getName();' At xtend compile, "feature.getName" is seen as a generic Java Object

Please let me know if you could use more information.
Re: Upgrading Xtext/Xtend Versions [message #1863524 is a reply to message #1863520] Wed, 07 February 2024 16:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14695
Registered: July 2009
Senior Member
the interesting question would be how you configure the ant task.
and which of the dependencies you use / if you have regex filters etc.
e.g. as we have here
https://github.com/eclipse/xtext/blob/9ee860cce6ea001ee12f8b8c71bb433fdc5b762b/org.eclipse.xtend.ide.tests/batch-compiler-data/ant/test.ant


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Upgrading Xtext/Xtend Versions [message #1863525 is a reply to message #1863524] Wed, 07 February 2024 17:34 Go to previous messageGo to next message
Nick Perez is currently offline Nick PerezFriend
Messages: 7
Registered: February 2024
Junior Member
Below is how the compile-xtend is configured in build.xml :


<!--========================================================================
! GENERATE-XTEXT-ARTIFACTS
!=======================================================================-->
<target name="generate-xtext-artifacts">
<java classpathref="classpath"
classname="org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher"
fork="true">
<arg value="${workflow}"/>
</java>
</target>

<!--========================================================================
! COMPILE-XTEND
!=======================================================================-->
<target name="compile-xtend">
<pathconvert pathsep="${path.separator}"
property="classpath-string"
refid="classpath">
</pathconvert>
<java classpathref="classpath"
classname="org.eclipse.xtend.core.compiler.batch.Main"
fork="true"
failonerror="yes">
<arg value="-cp" />
<arg value="${classpath-string}" />
<arg value="-d" />
<arg value="${basedir}/xtend-gen" />
<arg value="${basedir}/src-gen${path.separator}${basedir}/src" />
<arg value="-encoding" />
<arg value="UTF-8" />
</java>
</target>

<!--========================================================================
! COMPILE-JAVA
!=======================================================================-->
<target name="compile-java">
<mkdir dir="bin"/>
<javac classpathref="classpath"
destdir="bin"
source="11"
target="11"
includeantruntime="true">
<src path="src" />
<src path="src-gen" />
<src path="xtend-gen" />
</javac>
<copy todir="bin">
<fileset dir="src" excludes="**/*.java,**/*.xtend" />
<fileset dir="src-gen" excludes="**/*.java,**/*.xtend" />
<fileset dir="xtend-gen" excludes="**/*.java,**/*.xtend" />
</copy>
</target>

[Updated on: Wed, 07 February 2024 17:35]

Report message to a moderator

Re: Upgrading Xtext/Xtend Versions [message #1863531 is a reply to message #1863525] Wed, 07 February 2024 20:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14695
Registered: July 2009
Senior Member
what is
classpath-string

i also wonder if you should pass 11 as javaSourceVersion to the xtend compiler.

besides that a reproducibe project would be helpful


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Upgrading Xtext/Xtend Versions [message #1863534 is a reply to message #1863531] Wed, 07 February 2024 21:05 Go to previous messageGo to next message
Nick Perez is currently offline Nick PerezFriend
Messages: 7
Registered: February 2024
Junior Member
I'm not sure what that is used for. It was used 10 years ago in this xtext ant build:

https://xtextcasts.org/episodes/12-building-with-ant?autoplay=true

My build seems to be based off that, and updating to Java 11 with new xtext/xtend seems to have broke that build structure.
Re: Upgrading Xtext/Xtend Versions [message #1863536 is a reply to message #1863534] Thu, 08 February 2024 03:51 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14695
Registered: July 2009
Senior Member
Yes.
And it still does work.
But I need to debug and don't have the time to create a reproducer

and a trivial example works for me


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Thu, 08 February 2024 06:52]

Report message to a moderator

Re: Upgrading Xtext/Xtend Versions [message #1863660 is a reply to message #1863536] Mon, 19 February 2024 14:43 Go to previous messageGo to next message
Nick Perez is currently offline Nick PerezFriend
Messages: 7
Registered: February 2024
Junior Member
I trying to put something reproducible together that I can share. Another option I am considering trying is removing xtend all together and using the generated java code. Have you seen any projects that have done that in the past?
Re: Upgrading Xtext/Xtend Versions [message #1863662 is a reply to message #1863660] Mon, 19 February 2024 19:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14695
Registered: July 2009
Senior Member
yes i have.

boils mainly down which xtend features you are making heavy use of


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Mon, 19 February 2024 19:14]

Report message to a moderator

Re: Upgrading Xtext/Xtend Versions [message #1863675 is a reply to message #1863662] Tue, 20 February 2024 19:51 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7663
Registered: July 2009
Senior Member
Your early reports suggest a problem with 'Object'. In my experience this usually indicates a crazy configuration or just failure to rebuild adequately. The latter can be fixed by a few refresh-all / rebuild-all / restart cycles. Try a simple Xtext tutorial example to see if your installation is viable.
Re: Upgrading Xtext/Xtend Versions [message #1863718 is a reply to message #1863662] Thu, 22 February 2024 19:28 Go to previous messageGo to next message
Nick Perez is currently offline Nick PerezFriend
Messages: 7
Registered: February 2024
Junior Member
I only have one .xtend file used in as a generator when producing xtext artifacts. So maybe it wouldn't be too difficult to remove xtend from the build.

In the mwe2 file attached, xtend files are being generated and the java files I have for scoping and validation seem to be ignored.

With the attached workflow, do you see something I might be doing wrong?

I would to use existing scoping, validation, formatting java files in the xtext workflow instead of the generated xtend files.
Re: Upgrading Xtext/Xtend Versions [message #1863727 is a reply to message #1863718] Fri, 23 February 2024 13:43 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14695
Registered: July 2009
Senior Member
please check what the new project wizard produces as a workflow

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Contributing patches
Next Topic:Xtext 2.34.0 is out
Goto Forum:
  


Current Time: Sun Jul 14 21:24:02 GMT 2024

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

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

Back to the top