XCore code generation from command line [message #1795880] |
Mon, 01 October 2018 12:44  |
Eclipse User |
|
|
|
Hi,
al little question. I try to generate EMF code using the application org.eclipse.emf.codegen.Generator from the command line. The eclipse used to start the application contains EMF and XCore bundles. I get a ClassCastException.
Usage arguments:
[-projects <project-root-directory>]
[-dynamicTemplates] [-forceOverwrite | -diff]
[-generateSchema] [-nonNLSMarkers]
[-codeFormatting { default | <profile-file> } ]
[-model] [-edit] [-editor] [-tests]
[-autoBuild <true|false>]
[-reconcile]
<genmodel-file-or-platform-resource-uri>
[ <target-root-directory> ]
For example:
generate result/model/Extended.genmodel
org.eclipse.core.runtime.CoreException: EMF Error
at org.eclipse.emf.codegen.ecore.Generator$PlatformRunnable$1.run(Generator.java:455)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2292)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2314)
at org.eclipse.emf.codegen.ecore.Generator$PlatformRunnable.run(Generator.java:465)
at org.eclipse.emf.codegen.ecore.Generator$PlatformRunnable.run(Generator.java:133)
at org.eclipse.emf.codegen.ecore.Generator$PlatformRunnable.start(Generator.java:119)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:199)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:391)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:246)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
at org.eclipse.equinox.launcher.Main.run(Main.java:1501)
at org.eclipse.equinox.launcher.Main.main(Main.java:1474)
Caused by: java.lang.ClassCastException: org.eclipse.emf.ecore.xcore.impl.XPackageImpl cannot be cast to org.eclipse.emf.codegen.ecore.genmodel.GenModel
at org.eclipse.emf.codegen.ecore.Generator$PlatformRunnable$1.run(Generator.java:322)
... 18 more
Programmatically, we must include the following statement to enable the XCore bundles detection:
resourceSet.getURIConverter().getURIMap().putAll(EcorePlugin.computePlatformURIMap(true));
Is there a way to specify enable XCore bundle detection from the command line?
I pursue my investigation.
;-)
|
|
|
|
Powered by
FUDForum. Page generated in 0.08607 seconds