Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to skip @Generated annotation #6

Merged
merged 1 commit into from
Jul 14, 2019
Merged

Add option to skip @Generated annotation #6

merged 1 commit into from
Jul 14, 2019

Conversation

mtf90
Copy link
Contributor

@mtf90 mtf90 commented Jul 14, 2019

This PR adds an additional annotation parameter to @GenerateEmbeddedDSL that allows to skip the @Generated annotation in the generated DSL class. The two main motivations behind this are:

  • Allowing to build cross-version compatible JARs. Currently, if one uses the duzzt processor on JRE 8, the generated class will be annotated with @javax.annotation.Generated, an annotation that has been removed in JREs 11+. This forces end-users to include an additional dependency for newer JREs in order to use a product (e.g. AutomataLib/LearnLib) that uses duzzt.

  • By providing said dependency, end-users may violate Oracle's binary code license, which states:

    F. JAVA TECHNOLOGY RESTRICTIONS. You may not create, modify, or change the behavior of, or authorize your licensees to create, modify, or change the behavior of, classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun", “oracle” or similar convention as specified by Oracle in any naming convention designation.

    Even though the @javax.annotation.Generated is officially part of JRE 8, adding javax annotations to environments where they are not present (JRE 11+) may be interpreted as adding behavior, which would then prevent end-users to use products (e.g. AutomataLib/LearnLib) in a binary distribution with Oracle's JVM.

This feature is fully backwards-compatible, as this additional functionality is disabled by default and hence behaves like the current/latest version.

Adds a boolean flag to the @GenerateEmbeddedDSL annotation to skip the rendering of the @generated annotation in the generated DSL class file.
@misberner misberner merged commit 9765cef into misberner:master Jul 14, 2019
@misberner
Copy link
Owner

Thanks! Will create a new release with this soon-ish

@mtf90
Copy link
Contributor Author

mtf90 commented Jul 14, 2019 via email

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