-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
114: EMF generator generations fails #118
Conversation
The new commit fixes the instabilities with Codegen, and improves the UI (added a context menu on *.genmodel files to trigger the generation, clarified some parameters, ...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Camille! The genmodel generation works great for me, also the additional descriptions in the quick input field are a good improvement.
Regarding the code generation:
- If I trigger the the code generation on a newly created genmodel, the
src
folder is created outside the model folder in my case (pls see the attached screenshot). I assume this should be located inside the model folder, right?
- Also, the files in the generated
src
folder are not listed in.gitignore
- should we add the generated sources folder here?
One other question regarding the codegen backend app:
I tried to start the org.eclipse.emfcloud.ecore.codegen.product
but I get the following error. Did I miss something here or are there additional settings needed? If so, it would be great if we could offer a launch config as for the Ecore-GLSP App
.
!ENTRY org.eclipse.osgi 4 0 2021-12-07 17:33:22.988
!MESSAGE Application error
!STACK 1
java.lang.IllegalArgumentException: Expected argument: genmodel path; got []
at org.eclipse.emfcloud.ecore.backend.app.CodegenApplication.start(CodegenApplication.java:38)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:654)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1462)
at org.eclipse.equinox.launcher.Main.main(Main.java:1435)
I changed it to a path relative to the Theia workspace; so it's now more consistent with how it works in Eclipse. The expected genmodel path is //. We need to include the project, because GenModel can generate 4 different projects/plug-ins (Although we only support one at the moment): Java, Edit/Editor, and Tests. Each project uses its own path. So, if you only specify
For the example workspace, yes; it would make sense. However... I'm not sure what to add in the .gitignore. I usually don't commit anything from the workspace. Excluding src/ might be too much (why src/ and not src-gen/ ?). And if a users want to play with the tool a bit, it could be confusing to see some changes (ecore, genmodel) and not others (generated java code). So I'm not really sure I want to change anything in the gitignore.
We don't use this product like the other ones. It is copied to the Theia backend during build ( Until then, this application is not meant to be manually started; it's started via |
Oh I see, if using the entry
Ah you're right, thats true of course - then I'll agree to leave it like that.
Alright, that's fine then for me then :) |
Ah! I knew I was missing something, but I couldn't figure out what :) Indeed, the parameter-less version needs to be updated with a more appropriate value. I'll push an update. |
- Add a context menu on Genmodel files to make sure we have the correct input - Clarify the arguments for Genmodel and Codegen - Reconcile the genmodel before re-generation
- Compute a valid value for the java source folder, when creating a default GenModel (without explicit parameters)
24656b9
to
bc50467
Compare
I've updated the PR to use a better default value for the Java source folder. It currently takes the root project, and appends src-gen/ So if your model is located in:
The java source folder will be
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update Camille, looks great to me! 🎉
@@ -32,6 +32,7 @@ | |||
</features> | |||
|
|||
<configurations> | |||
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="2" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is relevant to solve the NPE described in #114
Caused by: java.lang.NullPointerException
at org.eclipse.core.internal.resources.CharsetDeltaJob.startup(CharsetDeltaJob.java:212)
at org.eclipse.core.internal.resources.CharsetManager.startup(CharsetManager.java:505)
at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2484)
at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2231)
There is still an issue with the code generator: it only works once. There are several causes (yet to be investigated):
This is mostly related to this old issue from the archived repo: #117
It would make it easier to separate the Backend/EMF Workspace from the Theia Workspace, and that would cause less interferences