Using SBT from Scala IDE
Asked Answered
M

2

36

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.

Madness answered 5/7, 2012 at 13:38 Comment(2)
Is Scala support better in Eclipse?Francinefrancis
Hi @ziggystar, a bit more than a year ago I tried Eclipse with the Scala IDE. At that point it was really slow. I then decided to try out IntelliJ Idea with the Scala plugin. This worked really well, but their documentation is really old, and they don't have nice and friendly customer support (not on my experience in any case). So now I decided to come back to using Scala IDE, and I must say it's really nice. Their predictive typing has improved drastically and so far I have had no problems whatsoever. Also, Eclipse is better supported on Ubuntu (which is what I use).Madness
A
18

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.

Abilene answered 5/7, 2012 at 13:56 Comment(0)
C
16

As a seasoned Eclipse user, I wondered the same thing. Amazed that no one seemed to be going that direction, I decided to roll my own project.

https://github.com/scalastuff/esbt

Install plugin, create or modify build.sbt and dependencies are fetched, project files updated.

It works for me, I use it every day. But it's not perfect or finished, and I'm not putting in a lot of effort in it at the moment. But do feel free to contribute!

Cher answered 20/7, 2012 at 16:44 Comment(2)
That's a great idea, thanks. It may be worthwhile to let the Scala-IDE user's group know: groups.google.com/forum/?fromgroups#!forum/scala-ide-userMadness
It seems to require Eclipse version <= 3.7. Anyone able to use this with Eclipse Juno (4.2)?Weight

© 2022 - 2024 — McMap. All rights reserved.