hollow
hollow copied to clipboard
Avoid import conflicts for generated API
The generated API shadows the concrete class names in the model, which causes import confusion and the need for full qualified class references when dealing with legacy code that contains both views of the model.
- Support adding a prefix/suffix to generated classes to differentiate them
- Consider support in examples/codegen for producing two model artifacts, say
<project>-modeland<project>-model-producerso for 'pure' Hollow projects it's possible to avoid leaking the concrete model to consumers at all
I ended up splitting our project into two halves - the producer pieces are runtime only in downstream projects, and are wired at runtime, so we don't have import ambiguity in the projects where we're using the generated model.
I created a separate consumer-model project and had it depend on compileOnly ':model'.