kotlincommand-line-interfacecode-generationkotlinpoet

Use file templates to generate Kotlin code


I'm building a tool to help my dev team to be faster when coding. For that, I thought on creating some kind on command line interface to generate code that's somewhat boilerplate.

I found kotlinpoet, but I'm not sure if it's possible and how to use file templates to generate the code. Since generating a class using code is not that idiomatic, I'd rather take a template and do some changes there and there.

Is this possible? Is there any other template code generation engine such as schematics for Angular?

Thank you,


Solution

  • You should try Telosys, this lightweight code generator has been created for project bootstrapping (with scaffolding for any kind of language or framework).

    It generates all the boilerplate parts of code. You just have to create your templates for Kotlin (the templates are written with Velocity).

    You can use it with Command Line or with the Eclipse plugin.

    For more information see these articles :

    Web site : https://www.telosys.org/