[Solved] Scala + SBT + Sponge plugin testing in IntelliJ

Hello!

I would like to develop a plugin in Scala.
I have tried using Gradle and the Scala-Plugin but it doesn’t work, I spent hours!
I prefer SBT because that works with Scala on my machine. But with plugin testing directly in IDE(IntelliJ) it gets difficult: I can’t add a run configuration to “GradleServerStart” because my project isn’t Gradle.

Any advice how to test my Scala plugin directly in IntelliJ using SBT? Is it even possible?

Thanks in advance! :grinning:

There is a scala plugin example in the Cookbook that may be useful to you

Thanks for the reply!
I saw that. My problem is setting up the run configuration with SBT to start the server out of IntelliJ.

The server/client must be launched via Gradle, but your plugin can certainly be added as a module dependency to either SpongeForge or SpongeCommon and IntelliJ should compile it just fine. It doesn’t matter whether the plugin is backed by gradle or SBT or even maven.

1 Like

Thanks for so fast answering!
I will try your approach.

Thanks @simon816 and @gabizou! Now it works!

I hope I write it down correctly:

  1. Clone SpongeForge repo
  2. Open it as a project from existing source
  3. Create a new project(Scala with SBT) in SpongeForge/PluginName and close it
  4. In the SpongeForge project import module from existing source(SpongeForge/PluginName)
  5. Now there should be in “View -> Tools Windows” Gradle and SBT!
  6. In Project Structure add to your plugin the module dependency SpongeForge
  7. Go to run configs and create(as it was in SpongeForge README.md) the run config but with classpath module your plugin module