Search code examples
gradlebuild.gradlegradle-kotlin-dsl

How is a gradle task type defined in Kotlin/


What is the kotlin Equivalent of the groovy statement

build.gradle

task clean(type: Delete) {
    delete rootProject.buildDir
}

in build.gradle.kts


Solution

  • Try this:

    tasks.register("clean").configure {
        delete(rootProject.buildDir)
    }