# Testing in-development Kotlin-DSL Gradle Plugin Locally

**URL:** https://discuss.gradle.org/t/testing-in-development-kotlin-dsl-gradle-plugin-locally/28386
**Category:** Help/Discuss
**Tags:** plugins
**Created:** [August 29, 2018, 12:54am UTC](https://discuss.gradle.org/t/testing-in-development-kotlin-dsl-gradle-plugin-locally/28386 "2018-08-29T00:54:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gabizou](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/gabizou/32/6929_2.png) [@gabizou](https://discuss.gradle.org/u/gabizou)
#### Post date: [August 29, 2018, 12:54am UTC](https://discuss.gradle.org/t/testing-in-development-kotlin-dsl-gradle-plugin-locally/28386/1 "2018-08-29T00:54:00Z")

</div>

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](https://github.com/SpongePowered/SpongeGradle/tree/429d465087774e9d7d1360f10cd6b24de4e43560) to [Kotlin-DSL](https://github.com/gabizou/sponge-gradle-plugin/tree/f9d669da7b8099e4a09fd0030a3d269dbdccc8c8).

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](https://docs.gradle.org/4.10-rc-2/userguide/custom_plugins.html#sec:getting_input_from_the_build) as exemplified with the [consumer test build script](https://github.com/gabizou/GradlePluginTests/blob/aa300f425abdb31dc105a19f8bbc0d9aa5fff0c1/build.gradle.kts#L21-L27), 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:

- [https://docs.gradle.org/current/userguide/custom\_plugins.html#sec:using\_your\_plugin\_in\_another\_project](https://docs.gradle.org/current/userguide/custom_plugins.html#sec:using_your_plugin_in_another_project)
- [https://docs.gradle.org/4.10-rc-2/userguide/custom\_plugins.html#sec:getting\_input\_from\_the\_build](https://docs.gradle.org/4.10-rc-2/userguide/custom_plugins.html#sec:getting_input_from_the_build)
- [https://github.com/gradle/kotlin-dsl/blob/master/samples/domain-objects/build.gradle.kts](https://github.com/gradle/kotlin-dsl/blob/master/samples/domain-objects/build.gradle.kts)
- [https://guides.gradle.org/testing-gradle-plugins/#testing-pyramid](https://guides.gradle.org/testing-gradle-plugins/#testing-pyramid)
- [https://guides.gradle.org/testing-gradle-plugins/#manual-tests](https://guides.gradle.org/testing-gradle-plugins/#manual-tests)
