Skip to content

Change addGeneratedAnnotationDate default to false - #123

Merged
Besi97 merged 2 commits into
mainfrom
feat/generated-annotation-date-default-false
Sep 2, 2026
Merged

Besi97 merged 2 commits into
mainfrom
feat/generated-annotation-date-default-false

Conversation

@Besi97

@Besi97 Besi97 commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Generated @Generated annotations no longer include a date attribute unless addGeneratedAnnotationDate = true is set explicitly. Timestamps in generated sources make builds non-reproducible and poison the build cache, so the opt-in should be the other way around for 6.3.0.

Breaking change: projects that rely on the date being present must now set addGeneratedAnnotationDate: true.

One non-obvious part: GeneratedInformation used to capture the flag at construction time, which ran before default initialization and before external mapping configs were merged - so the effective value could differ from what the config ends up holding. It now reads the flag from the config lazily at render time.

Unblocks #45 (marking Gradle codegen tasks as @CacheableTask).

Closes #44

Non-deterministic timestamps in @generated annotations break build
reproducibility and cacheability, so the opt-in should be the other way
around for the next major version. GeneratedInformation now reads the
flag from the mapping config lazily instead of capturing it at
construction time, so the value set by default initialization and by
merged external configs is honored when templates render.

Closes #44
The without-date case now relies on the new default instead of setting
the flag explicitly, so a regression of the default value fails here.
@Besi97

Besi97 commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

Checkstyle is failing only because: "the diff exceeded the maximum number of files (300)"

@Besi97
Besi97 merged commit 9af6de1 into main Sep 2, 2026
3 of 4 checks passed
@Besi97
Besi97 deleted the feat/generated-annotation-date-default-false branch September 2, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change addGeneratedAnnotationDate default to false

1 participant