Gradle Kotlin DSL - syntax to use a plugin?


(hanasaki jiji) #1

using gradle 4.9

I have a gradle build file moving to the Kotlin DSL. The groovy based used a plugin with

MYPLUGIN {…

What is the syntax for using it with Kotlin DSL and setting attribute a, b etc… and please confirm what goes in the “plugin {…” sections to enable the kotlin DSL.

Below from the Groovy DSL for Gradle when used with the Kotlin DSL (no surprise on the syntax issue. Just looking for the correct syntax.

Line 92: MYPLUGIN {
^ Unresolved reference: MYPLUGIN


(Mike Kobit) #2

Maybe looking at https://guides.gradle.org/migrating-build-logic-from-groovy-to-kotlin/ would help? It is going to be tough to answer your question without a reproducible example, I think.