Masabi / kotlinbuilder

MIT License
12 stars 3 forks source link

Use kotlin-metadata-jvm to generate accurate builders #4

Open burntcookie90 opened 6 years ago

burntcookie90 commented 6 years ago

You should be able to build the target class without grabbing constructors by reflection when using kotlin-metadata.

tddmonkey commented 6 years ago

Thanks for the feedback. It's something I started looking into but looks scary! Going the reflection route enabled me to get someone out much quicker. If you have any links to material to demystify the metadata it would be much appreciated

burntcookie90 commented 6 years ago

check out kotlin-moshi-codegen, i yanked a bunch of stuff from there for an internal project of mine. There should be a branch using kotlin-metadata.

tddmonkey commented 6 years ago

Been giving this some more thought - how do you picture the API working for nullability?

burntcookie90 commented 6 years ago

There wouldn't be any change in API (if you're handling that atm, that is). It should just generate a nullable param builder method.