Using SBT from Scala IDE

Jack picture Jack · Jul 5, 2012 · Viewed 19.8k times · Source

The path from SBT to Scala-IDE is well described in many places:

  1. Start with an SBT project
  2. Add the SBT plugin definition: addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0-RC1")
  3. Run the 'eclipse' command from within SBT
  4. Open Eclipse with an installed Scala-IDE add-on
  5. Import the project

What is the reverse for this? If I start a new project in Scala-IDE, can I just add a build.sbt file and somehow tell Eclipse to use this when running the application?

Apologies if this seems obvious to some, but I've recently moved from ItelliJ Idea to Scala-IDE and I'm not certain about setting up Scala-IDE to use SBT and my sbt config files.

Answer

Jean-Philippe Pellet picture Jean-Philippe Pellet · Jul 5, 2012

No, you cannot do this. The way to do it is as you described. Then, whenever you make changes to build.sbt (e.g., new jar dependency), rerun the eclipse command from sbt and refresh the project in Eclipse so that the newly generated files are reloaded.