Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Adds a javax.annotation.Generated annotation to generated sources. #52

merged 2 commits into from Mar 18, 2013


None yet
2 participants

erikvanoosten commented Mar 15, 2013

Generated sources should have a @Generated annotation to help tools like IDEs and checkers to be less strict. This pull request sets the standard Java annotation for that.

@kevinoliver kevinoliver commented on an outdated diff Mar 15, 2013

@@ -5,6 +5,7 @@
import java.util.Map;
import java.util.Set;
+@javax.annotation.Generated(value = "com.twitter.scrooge", date = "{{date}}")

kevinoliver Mar 15, 2013


nitpick: the docs indicate that value should be the class that does the generation, so I think that should be "com.twitter.scrooge.Compiler"


erikvanoosten commented Mar 16, 2013

Ah, that's an easy change.


kevinoliver commented Mar 18, 2013

Thanks for the contribution.

@kevinoliver kevinoliver added a commit that referenced this pull request Mar 18, 2013

@kevinoliver kevinoliver Merge pull request #52 from marktplaats-external/generated
Adds a javax.annotation.Generated annotation to generated sources.

@kevinoliver kevinoliver merged commit 158b769 into twitter:master Mar 18, 2013

1 check passed

default The Travis build passed

erikvanoosten commented Mar 19, 2013

I see I forget to update the value of the enum in one file. I'll fix that in another pull request.

@traviscrawford traviscrawford pushed a commit that referenced this pull request Feb 20, 2014

Travis Crawford + CI [split] Update scrooge to remove date from Generated annotation so ge…
…nerated code is reproducible.

Currently Scrooge sets the "date" field of the Generated annotation for code
it generates, which leads to unique generated code. This change stops
setting the generated date as its not needed in practice and complicates
pants caching because generated code is unique.

This annotation was originally added in
#52 with the stated intent of playing
nice with IDEs. I believe this change still allows the generated code to
play well with editors, as well as now playing well with the pants cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment