A minimal project template to start programming with Scala.
scala-min project includes:
- Sample Scala codes for Scala 2.10.2 with sbt-0.13.0
- ScalaTest examples (writing specs, logging, tagging tests, measuring code performances, etc.)
- Pre-configured settings for developing with IntelliJ IDEA
- A command for packaging projects with sbt-pack plugin.
sbt-pack
also generates installation scripts of you programs.
Download tar.gz archive or .zip of this project, then extract the contents.
Alternatively, you can run the following commands to extract the scala-min project:
$ mkdir myproject
$ cd myproject
$ curl -L https://github.com/xerial/scala-min/archive/master.tar.gz | tar xvz --strip-components=1
Run tests
$ ./sbt test
Run tests when updates of the source codes are detected
$ ./sbt "~test"
Run specific tests matching a pattern
$ ./sbt "~test-only *HelloTest"
Run tagged test only
$ ./sbt "~test-only *HelloTest -- -n test1"
Create a runnable package
$ ./sbt pack
$ target/pack/bin/hello
Hello World!!
Install your program
$ ./sbt pack
$ cd target/pack; make install
$ ~/local/bin/hello
Hello World!!
Create tar.gz archive of your program
$ ./sbt pack-archive
(myproject-0.1.tar.gz will be created)
Create IntelliJ project files
$ ./sbt gen-idea
Then, open this project folder in IntelliJ.
Add dependent libraries
Edit project/Build.scala
, then add libraries to libraryDependences
variable.
Rename the project name defined in project/Build.scala
as you like.