What are my options for auto code generation from text file?
I have a text file like this:
name: "Foo"
metric {
type: COUNTER
}
field {
name: "bar"
type: BOOL
}
And I want Kotlin to parse the file, extract field values, and generate function, like below, and append that function to the existing file FooBar.kt
fun countFoo(bar: Boolean) {
println("Success: $bar")
}
I found code generation from annotations but are there any well supported packages in Kotlin that will allow me to do what I described or should I go back to C++
thanks...