Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Cannot set the JDK compliance level in polishing transformation(Eugenia task polishing step cannot access literals via String lookup)
Cannot set the JDK compliance level in polishing transformation [message #1843834] Fri, 20 August 2021 04:02 Go to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

On Epsilon 2.2 and 2.3 I have a minimal eugenia generator workflow as per
https://www.eclipse.org/epsilon/doc/articles/eugenia-ant/


<project name="project" default="default">
<target name="default">
<epsilon.eugenia src="common/entity.emf" firstStep="clean" lastStep="genmodel"/>
</target>
</project>

It has a polishing transform, that aims to set the JDK compliance level:

Ecore2GenModel.eol

var genModel = GenModel!GenModel.all().first();
genModel.complianceLevel = "11.0";

It fails with the stack below, pointing to classloader management. This is presumably due to the resolution being done inside the ant task.

I have not found a way to access the enum or its literals and hence cannot find a workaround.

build.xml:5: class java.lang.String cannot be cast to class org.eclipse.emf.codegen.ecore.genmodel.GenJDKLevel (java.lang.String is in module java.base of loader 'bootstrap'; org.eclipse.emf.codegen.ecore.genmodel.GenJDKLevel is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @71567e73)
Re: Cannot set the JDK compliance level in polishing transformation [message #1843836 is a reply to message #1843834] Fri, 20 August 2021 05:44 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Hi Jörn,

There doesn't seem to be a JDK11 compliance level in GenJDKLevel [1] but the available compliance levels can be set as follows.

genModel.complianceLevel = GenModel!GenJDKLevel#JDK14;


Best,
Dimitris

[1] http://download.eclipse.org/modeling/emf/emf/javadoc/2.9.0/org/eclipse/emf/codegen/ecore/genmodel/GenJDKLevel.html
Previous Topic:Using external querying language
Next Topic:Eugenia Ant Task does not generate Model Project
Goto Forum:
  


Current Time: Sat Apr 27 07:49:21 GMT 2024

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

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

Back to the top