Not sure where does this question belong to, but I...
# getting-started
e
Not sure where does this question belong to, but I’m looking for some simple alternatives to
Poet
where I have full control on the generated Kotlin source code including removing redundant qualifiers, etc. My google research did not lead me any further than just construct the source as a String and write it to a file.
c
Poet does a great job at generating Kotlin code. As it’s generated, why does it matter if there are redundant qualifiers?
2
m
I’m with Chris, that library (like JavaPoet) is very good and opting for a string template won’t provide you the same level of flexibility and structuring. The reason why those modifiers are generated is stated in the docs:
Note: In order to maximize portability, KotlinPoet generates code with explicit visibility modifiers. This ensures compatibility with both standard Kotlin projects as well as projects using explicit API mode.
If you really really don’t like them, even if it’s generated code, you can add an additional step in your program and remove them before writing to a file.
e
Thanks for the answers!