This repository, intended for the Spring User Group Meetup on 28th Sep 2016, is an introductory lab to the scala language.
It is a patchwork of exercises taken from scala-labs and the Coursera course Functional Programming Principles in Scala.
Before starting the lab, make sure to setup your environment (section below) and optionally go through this Scala quick tour.
-
First make sure a version of the JDK is installed. Preferably java 8, although Java 6 and 7 will work too with scala-2.11.x used in this lab.
$ java -version java version "1.8.0_51" Java(TM) SE Runtime Environment (build 1.8.0_51-b16) Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
-
Then install the latest version of SBT (stands for "Simple Build Tool") the de facto build tool for Scala applications. After adding the
sbt
command to your PATH, validate with the command line$ sbt about [info] Set current project to redmart (in build file:/Users/redmart/) [info] This is sbt 0.13.12 ...
-
Finally Install a scala-compatible IDE, for example
-
Optionally, it is good to install Scala itself so you have access to its command-line REPL for experimenting
- Clone this repo
$ git clone https://github.com/damien-neveu/sg-scala-labs.git
-
Navigate to the
sg-scala-labs
folder and compile the project$ cd sg-scala-labs/
$ sbt clean compile
-
Open the project within your IDE
- In IntelliJ : File -> Open ->
/path/to/folder/sg-scala-labs
-> ChooseSBT
-> CheckAuto-Import
only -> OK
- In IntelliJ : File -> Open ->
-
Fix all exercises so their tests pass
$ sbt test