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

Rewrite Groovy code generation to Java #2648

Closed
mpkorstanje opened this issue Nov 27, 2022 · 3 comments · Fixed by #2669
Closed

Rewrite Groovy code generation to Java #2648

mpkorstanje opened this issue Nov 27, 2022 · 3 comments · Fixed by #2669
Assignees
Labels
🏦 debt Tech debt

Comments

@mpkorstanje
Copy link
Contributor

mpkorstanje commented Nov 27, 2022

🤔 What's the problem you've observed?

The cucumber-java and cucumber-java8 module generate annotations and interfaces using a groovy script.

Unfortunately the groovy-maven-plugin doesn't support Java 17 source code yet (groovy/gmaven#28). While we currently only have to run on Java 17 for #2644 it is not unimaginable that at some point in the future we'll also want to compile our own source code with 17 as well.

✨ Do you have a proposal for making it better?

With the increased release cadence of Java it would be prudent to keep the technology stack shallow and remove the dependency on Groovy and Groovy related components al together. So replacing the whole stack with pure Java would be beneficial.

📚 Any additional context?

There is a small chicken and egg problem to solve. Generating code with Java requires that the Java code is compiled. However because we are generating code, nothing has been compiled yet.

@mpkorstanje mpkorstanje added the 🏦 debt Tech debt label Nov 27, 2022
@mpkorstanje
Copy link
Contributor Author

It is possible to execute the maven-compile-plugin in the generate-sources phase. So it should be possible to compile the source generation code before executing it.

https://stackoverflow.com/a/43187728/3945473

@mlvandijk
Copy link
Member

Potential templating engines:

@mlvandijk mlvandijk self-assigned this Dec 21, 2022
@mlvandijk
Copy link
Member

From quick search, FreeMarker looks to be the most popular / active, so I'll try that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏦 debt Tech debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants