A development environment for #scalabcn Coding Dojos
This is a short post for assistants to the Scala Developers Barcelona Coding Dojo who may need help or advise installing an starting environment.
This is my personally preferred toolset (JetBrains IntelliJ + SBT) but there are other options (like Maven or Eclipse). Feel free to bring your own configuration!
The development environment
Install SBT. Manual installation is recommended.
Edit or create
~/.sbt/plugins/build.sbtand add the following line:
addSbtPlugin(“com.github.mpeltonen” % “sbt-idea” % “1.2.0”)
Install IntelliJ Community Edition
Launch it, go to Preferences, search for “Plugins”, Browse repositories and search for “Scala”
Install Scala and SBT plugins
A blank project
Create a directory for your project (e.g. ~/workspace/sample).
Create a file sample/build.sbt (the blank lines between lines must be preserved):
name := “sample”
scalaVersion := “2.10.0”
libraryDependencies ++= Seq( “org.scalatest” % “scalatest_2.10” % “1.9.1” % “test”, “org.mockito” % “mockito-all” % “1.9.0” % “test” )
Once to start with and every time you modify your build.sbt after that, run
sbt gen-ideato create IntelliJ descriptors form your build.sbt.
- The idea here is to follow the DRY tip and have only one definition for the project: SBT. The definition IntelliJ needs (the IntelliJ modules and project files), are therefore automatically generated from the sbt project definition.
Open the project in IntelliJ and… have fun!