Fredrick Eisele
07/15/2024, 8:37 PMFredrick Eisele
07/15/2024, 9:51 PMkotlin-dsl
plugin https://docs.gradle.org/current/userguide/kotlin_dsl.html#sec:kotlin-dsl_plugin with the instructions for
https://docs.gradle.org/current/userguide/implementing_gradle_plugins_binary.htmlChris Lee
07/15/2024, 10:14 PMkotlin-dsl
includes (applies) the java-gradle-plugin
, adding Kotlin-isms to the DSL. Use kotlin-dsl
if your plugin wishes to use the Kotlin Gradle DSL; use java-gradle-plugin
if your plugin is Java-based. Don’t use both (there’s no harm in doing so, its just redundant), and don’t use either if you are not developing a plugin.Fredrick Eisele
07/15/2024, 10:16 PMapply(Project project)
method of the Plugin<Project>
interface in Kotlin and/or Kotlin DSL.
I am looking for a simple complete example.
Are the samples from https://github.com/gradle/kotlin-dsl-samples/tree/master/samples/testkit modern?Chris Lee
07/15/2024, 10:17 PMGreetPlugin
looks to be modern/idomatic, though it isn’t an abstract class (it isn’t required to be, though that is a good practice).Fredrick Eisele
07/15/2024, 10:22 PMGreetPlugin
? there are at least two. One is written with *.kts one is part of https://github.com/gradle/kotlin-dsl-samples/tree/master/samples/testkit . Is there another one? There is also, https://github.com/gradle/greeting-plugin-example/tree/master/src/main/java/org/example/greeting but it is written in Java. Then there is https://github.com/gradle/kotlin-dsl-samples/blob/master/samples/buildSrc-plugin/buildSrc/src/main/kotlin/GreetPlugin.kt with is a buildSrc example.Chris Lee
07/15/2024, 10:28 PM