utopia-rise/godot-kotlin-native

Use Kotlin Poet to generate api classes [Moved from old repo]

chippmann opened this issue · 5 comments

Describe the problem or limitation you are having in your project:

Currently, godot's api kotlin code is generated using error prone StringBuilder.
It would be easier to maintain if we use a generation code api.

Describe how this feature / enhancement will help you overcome this problem or limitation:

Kotlin Poet is an api that provide easy to use code generation tools.
It is well maintained and our code would be much cleaner and easy to maintain.

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:

Replace string builders in generation methods of POJO in api-classes-generator

If this enhancement will not be used often, can it be worked around with a few lines of code?:

Not appropriate.

Is there a reason why this should be in this project and not individually solved?:

It concerns stability of the project.

I wrote in old repo:

@piiertho If you are refactoring the api classes generation now, you maybe can do issue #1 in one go?

@piiertho wrote in old repo:

@chippmann yes, I do that right after reworking code.

@piiertho wrote in old repo:

@chippmann Finally, I don't think it is a good idea to add the new config.json in the same branch, as we'll have probably to modify godot.def in godot-library according to gdnative_api_struct.gen.h from godot_headers.
Maybe a new feature could be to create a generator to keep time as it is bindings to godot_gdnative_core_api_struct.

I wrote in old repo:

Agreed 👍

I wrote in old repo:

@piiertho I think we can now close this issue or do you still have an improovement to make?