Compile groovy with debugging information

How to compile groovy source code with debugging information in Gradle. For Java we can use

tasks.withType(Compile) {

options.debug = true

options.compilerArgs = ["-g"]

}

The following should work:

tasks.withType(GroovyCompile) {
  options.debug = true
}

Thanks. it worked