Skip to content

Conversation

@kunalrkak
Copy link
Contributor

Before this PR

Existing @Generated annotations have a retention policy of SOURCE and are discarded after compilation.
This makes it hard to later tell if an object is conjure generated or not, forcing us to try to pattern match based
on known characteristics, i.e. palantir/gradle-baseline#3344. Using an annotation with a CLASS retention
policy would allow us to just look for the presence of that annotation on a class instead.

After this PR

==COMMIT_MSG==
Replace @Generated annotations with @ConjureGenerated in generated code.
==COMMIT_MSG==

Possible downsides?

@changelog-app
Copy link

changelog-app bot commented Nov 12, 2025

Generate changelog in changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

Replace @Generated annotations with @ConjureGenerated in generated code.

Check the box to generate changelog(s)

  • Generate changelog entry

/**
* The fully qualified name of the code generator that produced the annotated type.
*/
String value();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left this as a String to mirror the existing usage of @Generated but given we're exposing this more broadly, perhaps we should switch to an enum of supported types?

@kunalrkak
Copy link
Contributor Author

It looks like ErrorProne is wired up (with this config) to skip over code tagged with the @Ganerated annotation, which is why it's now complaining about some of the integration input files.

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.

2 participants