kotlin-builder-annotation
                                
                                 kotlin-builder-annotation copied to clipboard
                                
                                    kotlin-builder-annotation copied to clipboard
                            
                            
                            
                        Support builder generation for 3rd party types
It would be great if classes from dependencies could be targeted when creating builders, perhaps with an additional annotation like
@BuilderFor(SomeJavaOrKotlinBean::class.java)
class DummyPlaceholder
Some reasons for this:
- In some cases builders are needed for 3rd party classes
- The developer might actually control the sourcecode but other restrictions or requirements may apply. E.g. in Corda apps the state JARs where the POJOs are located needs to be as thin as possible, so other component types are preferably located in separate artefacts
I suppose i'm asking if a PR would be considered?
HI @manosbatsis sorry for the late reply - I've not been getting notifications, despite watching the repository. Yes, I'd happily consider a PR! :)
@YetAnotherMatt the above commit is still a WiP but feedback on my fork is welcome. The missing bits mostly relate with support for annotating "mixins" with @BuilderOf, i.e. types where property annotations like @DefaultValue can be used as if annotating a property of BuilderOf's "target" to provide the same features with @Builder.
BTW moving kapt-related helpers to a separate project might make sense. FWIW i would be more happy contributing there instead of duplicating the work e.g. like i do in https://github.com/manosbatsis/kotlin-utils/tree/master/kotlin-utils-kapt
Hi @manosbatsis thanks for the PR and update. I'll have a look as soon as I get the chance (which may not be that soon I'm afraid)