kotlingradlegroovyjvm

How can I understand if a Kotlin project is Gradle-Kotlin or Gradle-Groovy?


actually the title is self explanatory but I'm a beginner in Java and Kotlin environments. I have to rewrite a project from scratch and I don't have much experience with these languages and their environment. How can I understand from looking a project if it's Gradle-Kotlin or Gradle-Groovy based?

The project that I will transfer is written in Maven, I know that. But I want to implement a spesific architecture with same structure of a different project, so I need to understand what is what. Than, I can initialize my project with that DSL of I need.

I looked a Kotlin project as it indicated Gradle some places but I also saw Gradle-Groovy template in it so I'm not totally sure if it is Gradle-Kotlin or Gradle-Groovy.


Solution

  • 1. Check the Build Script File Extensions:

    Gradle-Kotlin DSL:

    2. Examine the Syntax in the Build Files:

    plugins {
        kotlin("jvm") version "1.5.10"
    }
    
    dependencies {
        implementation(kotlin("stdlib"))
    }
    
    plugins {
        id 'org.jetbrains.kotlin.jvm' version '1.5.10'
    }
    
    dependencies {
        implementation 'org.jetbrains.kotlin:kotlin-stdlib'
    }