question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rewrite more Groovy to Java

See original GitHub issue

The rationale

We’re looking for help in rewriting all possible production code from Groovy to Java. The Spock tests will remain written in Groovy, however ideally we’d prefer not to have Groovy in any library production code except for the DSL as such.

It’s been an ongoing process for years now. The main reason is the compatibility. Gradle comes with a bundled version of groovy and we have a Gradle plugin. Also we depend on groovy version in spring boot. That’s all problematic.

It’s discouraging for some part of the community to write a fix or a new feature in Groovy rather than in Java.

IDE support for groovy is getting worse every year now. Intellij IDEA introduces new bugs and other IDEs either don’t work at all or are even worse.

What do we want to rewrite?

I’d suggest going through all the modules outside of the spring-cloud-contract-spec modules and picking production class after class and rewriting it to java from groovy, running the tests and if the tests work make a commit.

As i said we want to leave the Groovy DSL (groovy-spec module) and the spock tests.

How to start?

Pick a class / package / module, notify the others in a comment and start converting the classes! Once you’re done file a pull request and link it to this issue.

Checking if code works

Before you file a pull request you can run

$ ./mvnw clean install -Pintegration,docs

That way you’ll also run the standalone samples that simulate end to end tests. It will also build the documentation and check if the docs aren’t broken.

Please note that if you rewrite a class that contains such tags as

// tag::foo[]
// end::foo[]

that means that most likely that the code within those comments is used in the documentation.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:30 (27 by maintainers)

github_iconTop GitHub Comments

2reactions
stessycommented, Aug 14, 2020

I can help as well.

I’m currently rewriting the module spring-cloud-contract-converters.

2reactions
saket88commented, Aug 14, 2020

I want to contribute

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to convert Groovy to Java automatically?
IntelliJ IDEA has a quite decent support for refactoring of groovy code. It also has a source code level converter from Groovy ->...
Read more >
Switching from Groovy to Java - Adaptavist Labs
In this blog post I'll talk a little bit about the reasons for that change and the things we miss from Groovy. 1....
Read more >
Integrating Groovy into Java Applications - Baeldung
Learn about the latest techniques to integrate Groovy into a Java application.
Read more >
Integrating Groovy in a Java application
The Groovy language proposes several ways to integrate itself into applications (Java or even Groovy) at runtime, from the most basic, ...
Read more >
Migrating build logic from Groovy to Kotlin - Gradle User Manual
You must run Gradle with Java 8 or higher. Java 7 is not supported ... Read more in the Gradle Kotlin DSL Primer....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found