4

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,

Ignacio Ruiz
  • 611
  • 10
  • 21
  • Kotlin is made for removing all the boilerplate. Which boiler-plate do you think should not be there in kotlin, you can appeal for that in Kotlin/KEEP. They process them ASAP. – Animesh Sahu May 19 '20 at 14:31
  • 1
    All the boilerplate generated by the use of a code architecture such as Clean Architecture: mappers, layers, models, etc. I'm not talking about boilerplate in Kotlin itself, man. – Ignacio Ruiz May 19 '20 at 14:46

1 Answers1

4

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/

JackPat99
  • 232
  • 1
  • 10
  • Hey. Thanks for this. I researched template engines thanks to you. Even if they are supposedly created for HTML on web servers, I think I can use some to generate Kotlin. Thank you! – Ignacio Ruiz May 20 '20 at 06:04