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

Gradle: Migrate from Groovy to Kotlin #1994

Open
yhtMinceraft1010X opened this issue Apr 16, 2023 · 1 comment
Open

Gradle: Migrate from Groovy to Kotlin #1994

yhtMinceraft1010X opened this issue Apr 16, 2023 · 1 comment

Comments

@yhtMinceraft1010X
Copy link
Contributor

What feature(s) would you like to see in RepoSense

Our current build.gradle script uses the Groovy syntax (example below):

plugins {
    id 'application'
    id 'checkstyle'
    id 'idea'
    id 'jacoco'
    id 'java'
    id 'com.github.johnrengelman.shadow' version '7.1.2'
    id 'com.liferay.node' version '7.2.18'
    id 'com.github.psxpaul.execfork' version '0.2.0'
    id 'com.palantir.git-version' version '0.13.0'
}

Is the feature request related to a problem?

Kotlin has been recommended due to cleaner syntax and enhanced editing experience in IDEs, particularly IntelliJ. Below shows the equivalent block in Kotlin syntax:

plugins {
    application
    checkstyle
    idea
    jacoco
    java
    id("com.github.johnrengelman.shadow") version "7.1.2"
    id("com.liferay.node") version "7.2.18"
    id("com.github.psxpaul.execfork") version "0.2.0"
    id("com.palantir.git-version") version "0.13.0"
}

One key advantage of Kotlin, imo, is that the syntax is much closer to that of Java, which we use for the backend, compared to Groovy. As an example, Groovy allows single and double quotes for strings whereas Kotlin requires strings to be in double-quotes, just like in Java.

Having a more standardised syntax means that someone who starts work on build.gradle.kts will find it easier to transition to the Java code.

If possible, describe the solution

Useful links:

@damithc
Copy link
Collaborator

damithc commented Oct 29, 2023

Sorry for not chiming in earlier. I'm not sure if we want to do this in the end. While Kotlin has advantages, our main source of developers come from using addressbook-level3, which means it may be better to use the same syntax here as the one used there.
Still, no harm exploring the idea with an experimental PR to see how it goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: For contributors
Development

Successfully merging a pull request may close this issue.

3 participants