Help with Kotlin on leJOS (Lego Mindstorms) using IntelliJ/Gradle

We have a github discussion thread going on how to make it all fit together, and have it working! But we could use someone with Kotlin/Gradle experience to chime in with best practices, especially with Gradle tasks, plugins ( apply plugin vs plugins { ) etc.

  1. Compile
  2. Creates a leJOS compatible jar
  3. Find the device
  4. scp the jar to the mindstorms device
  5. execute the app

Sadly, I do not have time for complete answer, but you have something strange there.

  1. You do not specify the version of Kotlin. You should either use old gradle notation with buildscript configuration or new notation with plugins. Either of them, but not together. This page has everything you need.
  2. Do not mess with jar manifest and sourcesets if you do not need it. If you want single executible jar, just use shadow plugin.
  3. I am not sure that java 6 is an option.

Does anyone know how to use gradle the “right” way for this? Specifically if we should be using the Kotlin Gradle DSL, (“plugins”? “plugin”?) or other ways to write the config files?

It feels like it should be easy for someone who knows Gradle.