Upgrading Xtext/Xtend Versions [message #1863505] |
Tue, 06 February 2024 22:31  |
Eclipse User |
|
|
|
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 #1863520 is a reply to message #1863505] |
Wed, 07 February 2024 14:11   |
Eclipse User |
|
|
|
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 #1863525 is a reply to message #1863524] |
Wed, 07 February 2024 17:34   |
Eclipse User |
|
|
|
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] by Moderator Report message to a moderator
|
|
|
|
|
|
Re: Upgrading Xtext/Xtend Versions [message #1863660 is a reply to message #1863536] |
Mon, 19 February 2024 14:43   |
Eclipse User |
|
|
|
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 #1863675 is a reply to message #1863662] |
Tue, 20 February 2024 19:51   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03394 seconds