antlr4
antlr4 copied to clipboard
Annotate Java files as being generated
hi. I don't think it's a good idea to add an option to the entire tool just to get this tiny feature for one out of 10 targets. What problem are you solving here may I ask?
The problem I try to solve is referenced:
- Add @SuppressWarnings and @Generated annotations to all generated classes and interfaces #2568 There is also another related issue:
- javax.annotation.processing.Generated #2512 In both issues, feedback was positive that a PR would be welcomed and reviewed. So this PR tries to solve theses issues.
Thanks very much for the detailed response. Could you modify this so all it does is add @generated("ANTLR") in Java.stg? Can I don't think I'm ready for options or any other warning suppression at this time. thanks!
Unfortunately things are not that easy... The original annotation @javax.annotation.Generated is not longer part of Java 11. You can use @javax.annotation.processing.Generated instead or bring back the old javax stuff with the artifact javax.annotation:javax.annotation-api. As Antlr targets a wide ranch of Java versions, a command line option would definitely make more sense.
hm...ok, yeah, I don't want to add an option just for this. As it doesn't make sense to add something that will only work with certain versions then I guess I'll close. sorry!