Use kotlin compiler plugin and reflection to generate code [Moved from old repo]
See original GitHub issueDescribe the problem or limitation you are having in your project:
Currently the api-classes-generator
and the entry-generator
use a errorprone and hard to understand code generation using stringBuilders.
The code would be much cleaner and easier to maintain if we use reflection to generate the api-wrapper and annotations for the entry-classes generation.
Also it would make the project easier to use as a user doesn’t have to write config json’s anymore.
Describe how this feature / enhancement will help you overcome this problem or limitation: One no longer needs to configure the errorprone json files and maitanance is much simpler.
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work: None to provide.
Describe implementation detail for your proposal (in code), if possible:
Use the compiler plugin created in issue #13 for the config generation.
Maybe use kotlinPoet for the api classes generation -> done in #14
If this enhancement will not be used often, can it be worked around with a few lines of code?: Yes with the current system. But it’s not user friendly at all.
Is there a reason why this should be in this project and not individually solved?: Yes as the code generation is the main part of the project.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
@Wavesonics Then you dont have to change a thing. I configured it to be mandatory to execute before any kotlin compile task. So its executed during a normal build as well. So calling just build is fine.
That’s great news, once you get the new task in, I can change the task being called from the Editor Plugin in #33 (currently it’s calling build)