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?
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.