Testing in-development Kotlin-DSL Gradle Plugin Locally

plugins

(Gabriel Harris-Rouquette) #1

Hi all, I’ve had a great deal of time spent on googling, reading, fiddling, and thinking about migrating a current groovy/java Gradle plugin to Kotlin-DSL.

Without really focusing on the reasons why I’m migrating to Kotlin-DSL, here’s a few that I’ll point out:

  • Our gradle plugins were initially written in the days of Gradle 2.3, before extensions came in to replace conventions
  • I personally hate groovy and the lack of IDE support for groovy and gradle groovy scripts
  • Kotlin allows for more integration and static analysis that so far has helped a lot more than trying to write something in groovy

I’ve so far managed to get the plugin to work currently with a single task, and it’s configurable as exemplified with the consumer test build script, even allowing the dependency of the plugin locally deployed to Maven local prior to the plugin being published in the community Gradle Plugin Portal.

My issue is however, I can’t get IntelliJ to recognize plugin binary updates without telling IntelliJ to Invalidate Caches / Restart....

Currently I get around local binary changes by re-deploying to maven local, invalidating caches, and then IntelliJ is correctly linking the gradle plugin binary. I used to see something about “build script dependencies have updated, do you wish to update” or something there of, but I figured I’d ask here on the Gradle forums as I’d imagine there’s better setups than what I currently have to do what I want.

Some links of things I’ve read: