-
Notifications
You must be signed in to change notification settings - Fork 6
Generate either Java code or Xtend code for overridden classes #93
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
Conversation
|
Hi Philippe ! Nice to see your contribution ! Could you add in this review the screenshot of the new dialog ? And what you get as result ? |
|
Hi Olivier,
Sure I will do
BR
Philippe
|
|
The result is that the Implementation files for overridden classes are either generated in Java (by default) or in Xtend if this setting is applied on the Developer structure dialog |
|
This is pretty cool ! I like it ! Have you added unit test to check the Xtend code result ? |
|
The .log file in core.test should be removed... right ? I will check the code later. If we don't have unit test for Xtend generation, I can accept the review but I would like you to put in the dialog for the Gen Class Type : Java. XTend (beta) |
|
Ok I'm checking how to add some unit tests then |
|
To add tests, it is easy... you must extend the GenModelAddonTestCase which will generate a template project. Then you should focus on the test cases that test the code generation ... like TestGenerics or TestInterfaceGeneration or TestExtensionGeneration. I think you should copy this classes for xtend (may be in another package)... The important issue to test is to be sure of the right names and code structure in the generated code. When you launch the tests you can launch them using a RAM disk (in memory), this will increase the speed for testing. You will also see the result in the junitruntime workspace. Another tip, you should probably have a way to test with an XTend generator and java generator. See the WorkspaceConfigurator that will populate the runtime workspace with the generated sample projects. Probably you will have to generate one of them especially with your new XTend generation. |
|
I've added some tests to check that overriden implementation classes are generated as xtend and not java. |
opcoach
left a comment
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.
Version should be increased. I will check that.
|
|
||
| @Test | ||
| public void testXtendClassNames() { | ||
| assertFileExists("src/com//opcoach/xtend/project/impl/CompanyImpl.xtend"); |
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 guess only 1 slash is enough (everywhere in this test)
|
This is ok for me. I will make another commit to increase the version number. |
|
Thank you for your contribution. This is now the 2.6.0 release of GMA. I will provide it on the opcoach web site for the next 2022-12 delivery. https://opcoach.com/repository/ |

Currently override of implementation classes if Java code. I would like to add the choice to generate Xtend classes instead.
This means modifying the Generate Developer Structure dialog and all related generate dev structure files.