Scala SBT project template ready to be imported into Eclipse
Surprising as it sounds, Eclipse doesn’t support sbt out of the box, not even in the Scala IDE. At least I wasn’t able to find a way of how to generate an sbt project from within Eclipse. Hence, I wrote my own bash script which generates a ready-to-use Eclipse-compliant minimalistic sbt project.
The script sbt-eclipse.sh (see below) has yet to be polished. However, it works and gets the job done.
sh ./sbt-eclipse.sh [project_name] [project_version] [scala_version] [sbt_version]
As you can see the script takes a bunch of arguments, all of which are optional. Default settings:
project name: sbt_eclipse_project project version: 1.0 scala version: 2.11.7 sbt version: 0.13.9
sbt-eclipse.sh:
https://gist.github.com/zezutom/a10d3c52179963f4fecd
The script generates a project skeleton, adds the Eclipse plugin into the project configuration and finally builds it by running sbt eclipse.
Once the build finishes the project is ready to be imported into Eclipse (File > Import > Existing Projects into Workspace):
Project Explorer:
Happy coding and thanks for reading.