Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » How to disable generics when generating source from EML with ecore and XSDs
How to disable generics when generating source from EML with ecore and XSDs [message #1785572] Tue, 17 April 2018 03:05 Go to next message
Bill Sherman is currently offline Bill ShermanFriend
Messages: 6
Registered: April 2018
Junior Member
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
Re: How to disable generics when generating source from EML with ecore and XSDs [message #1785576 is a reply to message #1785572] Tue, 17 April 2018 06:20 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 29349
Registered: July 2009
Senior Member
In the future, Better to ask on the EMF forum.

https://www.eclipse.org/forums/index.php/f/108/

Even the script looks ancient given that SDO has not been supported since forever!

Note all properties (there are hundreds) of the GenModel can be controlled via command line parameters. The *.genmodel's "Compliance Level" property set to 1.4 will avoid generating generics.

Previous Topic:Build error-'strdup' was not declared in this scope
Next Topic:Automating the creation of HMI with Eclipse RCP
Goto Forum:
  


Current Time: Sun May 20 23:43:02 GMT 2018

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

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

Back to the top