Reputation: 3797
The documentation only gives an example in Groovy DSL:
plugins {
id "org.jetbrains.kotlin.plugin.noarg" version "1.3.31"
}
noArg {
annotation("com.my.Annotation")
}
How does this translate into Kotlin DSL?
Upvotes: 3
Views: 3067
Reputation: 3797
Because Kotlin DSL is statically typed, the syntax will differ slightly from Groovy DSL.
import org.jetbrains.kotlin.noarg.gradle.NoArgExtension
plugins {
id("org.jetbrains.kotlin.plugin.noarg") version "1.3.31"
}
configure<NoArgExtension> {
annotation("com.my.Annotation")
}
Differences:
id
s in the plugins
block to accept an argument of the plugin id.NoArgExtension
which is then imported. It's required for the configure
block in which the plugin can be configured similar to the Groovy DSL.Upvotes: 2