This is a simple lightweight template for starting a scala project with sbt.
It comes with:
- sbt-eclipse plugin
- scala-test and specs templates
To get started:
-
To download and launch sbt:
git clone git://github.com/dph01/scala-sbt-template.git cd scala-sbt-template ./sbt -
To load your project into Eclipse:
sbt> eclipseThen from within Eclipse, select File->Import->General->Existing Projects Into Workspace, and select your project directory.
-
Write your code in src/main/scala. To run your program, specify the name of your main class in build.sbt, e.g.:
mainClass := Some("com.damianhelme.App")In sbt:
sbt> reload sbt> runYou'll probably also want to change the 'name' and 'organisation' sbt configuration settings in build.sbt.
Note the reload only needs to be done once whenever you change the build.sbt file
-
Write your tests in src/test/scala (some examples have been included). To run all your tests:
sbt> test -
To run just one test:
sbt> test-only com.damianhelme.AppTest
For comments, questions, etc. please see the accompanying blogpost.