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

Gherkin java codegen #1959

Merged
merged 9 commits into from
Apr 21, 2022
Merged

Gherkin java codegen #1959

merged 9 commits into from
Apr 21, 2022

Conversation

aslakhellesoy
Copy link
Contributor

@aslakhellesoy aslakhellesoy commented Apr 19, 2022

Summary

Generate GherkinDialects.java at build time, using Groovy as a template engine and the root gherkin-languages.json as data for the template. This fixes #1957.

Details

With this change the library no longer needs to parse JSON at runtime. This makes the library:

  • more performant (not really important)
  • smaller memory footprint (not really important)
  • more secure and less maintenance needed, because 3rd party JSON parsers tend to have CVEs

With this change there is no need to copy the gherkin-languages.json file either.

Motivation and Context

See #1957

Types of changes

  • Breaking change.

Checklist:

  • The change has been ported to Java.
  • The change has been ported to Ruby.
  • The change has been ported to JavaScript.
  • The change has been ported to Go.
  • The change has been ported to .NET.
  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have updated the CHANGELOG accordingly.

@aslakhellesoy aslakhellesoy marked this pull request as ready for review April 19, 2022 21:30
@aslakhellesoy
Copy link
Contributor Author

Thanks for the feedback @mpkorstanje - fixed now I think. Good to merge?

Copy link
Contributor

@mpkorstanje mpkorstanje left a comment

Choose a reason for hiding this comment

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

LGTM. The one nit pick aside.

@mpkorstanje
Copy link
Contributor

Cheers btw.

@ciaranmcnulty
Copy link
Contributor

Looks good 👍

@aslakhellesoy aslakhellesoy merged commit ab25bfc into main Apr 21, 2022
@aslakhellesoy aslakhellesoy deleted the gherkin-java-codegen branch April 21, 2022 10:51
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.

gherkin/java: Use generated code instead of reading gherkin-languages.json
3 participants