Skip to content

Add option to exclude timestamp of Generated annotation #152

@kingg22

Description

@kingg22

Would it be possible to add an option so that the generated code includes a @Generated annotation, but without a timestamp?
This would help exclude generated sources from analysis tools while keeping reproducible builds intact (timestamps usually break reproducibility).
Example Hibernate disable generated annotation because they have reproducible build.

JClassDef generateModel() throws IllegalStateException {
// Add generated annotation if required
final TypeElement generatedAnnotation = messageInterface.generatedAnnotation();
if (generatedAnnotation != null) {
final JType generatedType = typeOf(generatedAnnotation.asType());
sourceFile._import(generatedType);
classDef.annotate(generatedType)
.value("value", getClass().getName())
.value("date", JExprs.str(ClassModelHelper.generatedDateValue()));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions