Sbt is a build tool for scala projects.
###Installing scala and sbt on Mac using brew:
brew install scala --with-docs
brew install sbt
Also, optionally install drip whihc is a JVM launcher which preloads and keeps a warm JVM instance to make things appear faster.
Export the following variables (probablt to ~/.bashrc or ~/.bash_profile), to make life easier:
export JAVA_HOME=$(/usr/libexec/java_home)
export SCALA_HOME=/usr/local/Cellar/scala/2.10.3/libexec
export JAVACMD=drip
export DRIP_SHUTDOWN=30
# to avaoid jvm out of space errors while using sbt
export SBT_OPTS="-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:PermSize=256M -XX:MaxPermSize=512M"
###Creating Project Structure
To create a project structure for scala projects, use the attached buildScalaProject.sh
scipt in this gist.
###Woring with IntelliJ To configure IDEA 12, start by installing the Scala plugin from the plugin repository and restart IDEA.
To work with IntelliJ use, sbt task 'gen-idea' from inside the project.
(Or)
Alternatively creating scala project from inside IntelliJ
- start a new project in IDEA and select "Scala Module". Enter the project name, click on the New button for Project SDK. The $JAVA_HOME directory should already be selected in the dialog which appears, just click on Choose to proceed.
In Scala settings, select the "Set Scala Home" radio button and enter "/usr/local/opt/scala/idea" in the text box below it. Click on "Finish" to create the new project.
@balachandra you're welcome!