-
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
#10 Finalize the integration of Code Generation #36
Conversation
Signed-off-by: Simon Graband <[email protected]>
Signed-off-by: Camille Letavernier <[email protected]>
Signed-off-by: Camille Letavernier <[email protected]>
- The Ecore Codegen application is org.eclipse.emf.codegen.ecore.Generator; not org.eclipse.emf.codegen.CodeGen Signed-off-by: Camille Letavernier <[email protected]>
Signed-off-by: Simon Graband <[email protected]>
Signed-off-by: Simon Graband <[email protected]>
Signed-off-by: Simon Graband <[email protected]>
} | ||
|
||
generateCode(genmodelPath: string, workspacePath: string): Promise<string> { | ||
const jarPath = path.resolve(__dirname, "..", "..", "..", "..", |
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.
We should probably have a single method for this. We should also be able to call directly the ecore_glsp_backend
binary, which would simplify the command line a lot. Something like this:
ecore_glsp_backend -nosplash [app-args]
Rather than:
java -jar -cp <equinox launcher> <Main> [app-args]
@Override | ||
public Object start(IApplicationContext context) throws Exception { | ||
String[] args = getArgs(context); | ||
createEcore(args[0], args[1], args[2], Paths.get(args[3], args[0]+".ecore")); |
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.
It would be nice to check the arguments before passing them like this, to get proper error reporting (Rather than "IndexOutOfBounds" exceptions)
URI uri = URI.createFileURI(ecoreFile.getAbsolutePath()); | ||
Resource ecorePackageResource = resourceSet.getResource(uri, true); | ||
EPackage rootPackage = (EPackage) ecorePackageResource.getContents().get(0); | ||
if(args[1].equals("") || args[2].equals("")){ |
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 test is redundant with the inner-ifs
@Override | ||
public Object start(IApplicationContext context) throws Exception { | ||
Generator codegen = new Generator(); | ||
String[] args = getArgs(context); |
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.
I would extract the args to individual variables, and stop using the string-array as early as possible. Manipulating arg[0] inside the code isn't really readable
The introduction of a Tycho-based product caused some issues with the build, but they should be solved now (I'll squash the releng commits to clean up a bit). |
Signed-off-by: Camille Letavernier <[email protected]>
Signed-off-by: Simon Graband <[email protected]>
ed52d67
to
854875d
Compare
Fixes #10