-
Notifications
You must be signed in to change notification settings - Fork 430
Sample plugin showing custom DSL #1081
Comments
Sry but I don't get your question 🙃 |
@StefMa e.g. https://github.com/gradle/kotlin-dsl/blob/master/build.gradle.kts#L110-L140 Shows the build.gradle of this project, using the idea plugin + configuration. It has several 'type safe kotlin builders / dsl's' But attempting to make the same in a project extension hasn't worked well for me. Seeing if there are any utilities, or if it's all manual, or a basic example of how to do that, would be excellent in order to make the plugin I plan on publishing feel like a native kotlin-dsl plugin. |
Ok, understood. But you are talking about of having your own plugin (or plugin extension). But the way: |
I've been avoiding gradle due to groovy, this is the first time I've attempted to make my own plugins (and write Kotlin), most of the examples have been super helpful when combined with the gradle docs. Between my limited Scala knowledge, Java 8 experience, and C#, I've been able to mostly make heads and tails of Kotlin by referring to the documentation.
From what? The few attempts I've made havn't had that nice syntax apply, which is why I've asked that it be a sample, so others can benefit. Even if the sample shows that you don't need to write the builders and glue code yourself, because currently that's the idea that I had, if you write a plugin in Kotlin Script, that you had to do that yourself (as opposed to writing it in groovy, where it would be generated). (I'll push to my repo and show you when I have access to my changes next (I'm not on that machine currently)) |
It would be great to see a plugin that provides a custom DSL, that matches kotlin-dsl styles for configuring tasks using custom functions.
If it's already in the samples, it's not clear from the sample readme where it is.
The text was updated successfully, but these errors were encountered: