Add @Generated annotation to generated files
Probably needs some build.grade/BUCK file fixes.
Fixes #551
Thanks a lot for your work on this, @vinc3m1! I was hopoing to add that in the future) Let me share a couple of thoughts about the topic below.
We'd like to remove that mandatory dependency on Generated annotation.
Can you refactor this to use string-literal for classname and remove that dep? (Similar to how Moshi is doing: https://github.com/square/moshi/blob/0943ef5a6165c2c2796eb0dafd2246e58982cc0b/kotlin/codegen/src/main/java/com/squareup/moshi/kotlin/codegen/JsonClassCodegenProcessor.kt#L59). So, that by default we won't add this annotation and use that dep, but if our consumers will need it, they can add it along with litho.
And let the trigger for this annotation to be added be a CLI parameter. But we don't need to support JDK9 annotation, just the flag whether to add it or not.
Changed to use a string literal, this drops the dep from the annotation process, but the original CL never quite required the dep on underlying dependencies either (at least with gradle, since they were compileOnly).
The trigger is currently based on whether the processing environment actually has the class on the classpath, which means the consumer has the dependency already, otherwise the annotation will not be added.
bump
@vinc3m1 has updated the pull request. Re-import the pull request