How to disable generics when generating source from EML with ecore and XSDs [message #1785572] |
Mon, 16 April 2018 23:05  |
Eclipse User |
|
|
|
I'm trying to make "a slight adjustment" to an old Eclipse project. There's an Ant build script, existing ecore file, existing XSD files, and existing (old) ecore jar files. The Ant script creates Java source from the ecore + XSD and attempts to compile the resulting source with the old ecore jar files in the classpath.
When the generated code is compiled I'm seeing 100 errors. All are related to the use of generics, such as EList<String>. I think that the old ecore jar files that came with the project do not support generics. These old ecore jar files are also present on the ultimate destination system which has proprietary hardware and software. I am not able to update the old ecore jar files on that destination system.
What can I do to indicate to Eclipse Oxygen (with modeling support, obviously) that it should generate Java code that does not use generics?
The Ant build script generates the Java code by using <java> to start an instance of Eclipse and passes command line arguments to it:
<java fork="true" classname="org.eclipse.equinox.launcher.Main">
<arg value="-clean"/>
<arg value="-noupdate"/>
<arg value="-data"/>
<arg path="${redacted}"/>
<arg value="-application"/>
<arg value="org.eclipse.xsd.ecore.importer.XSD2GenModel"/>
<arg file="${stubs.xsd}"/>
<arg file="${stubs.genmodel}"/>
<arg value="-modelProject"/>
<arg path="${stubs.dir}/redcated"/>
<arg value="src"/>
<arg value="-sdo"/>
<arg value="-templatePath"/>
<arg file="${stubs.templates}"/>
<classpath>
<pathelement location="${java.class.path}"/>
<pathelement location="${eclipse.dir}/plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar"/>
</classpath>
</java>
Thanks,
Bill
|
|
|
|
Powered by
FUDForum. Page generated in 0.08103 seconds