reposense / RepoSense

Contribution analysis tool for Git repositories
https://reposense.org
MIT License
250 stars 154 forks source link

Gradle: Migrate from Groovy to Kotlin #1994

Open yhtMinceraft1010X opened 1 year ago

yhtMinceraft1010X commented 1 year ago

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 commented 1 year ago

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.