-2

In build Gradle script we have the following:

ext.sourcesDir = "${buildDir}/generated-sources/jaxb" ext.classesDir = "${buildDir}/classes/jaxb"

Is it Groovy language?

What does "ext." mean?

How to rewrite these lines to Kotlin?

Albert
  • 131
  • 2
  • 6

1 Answers1

0

When you are using build.gradle, you are using the Groovy DSL for Gradle.

ext refers to the Extra Properties.

The above lines for the Kotlin DSL can be rewritten as:

val sourcesDir by extra { "${buildDir}/generated-sources/jaxb" }
val classesDir by extra { "${buildDir}/classes/jaxb" }

Refer to Gradle Kotlin DSL Primer for more details.

Cisco
  • 20,972
  • 5
  • 38
  • 60