Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 2.22 KB

scala_scalatest.md

File metadata and controls

73 lines (52 loc) · 2.22 KB

Scala - Bootstrapping with ScalaTest

Prerequisites: JDK - please download and install from AdoptOpenJDK

Steps

  1. Install sbt:

    Mac:

    $ brew install sbt@1

    Windows: Install msi from here

    Linux: Installation instructions

  2. Create new project from seed:

    $ sbt new sbt/scala-seed.g8

    After installing everything, you will be prompted for the project name:

    A minimal Scala project.
    
    name [Scala Seed Project]:

    Enter kata and then cd kata

  3. You will find an example source file at src/main/scala/example/Hello.scala and an example test file at src/test/scala/example/HelloSpec.scala.

  4. You may run the tests with:

    sbt test

    To have sbt watch the file system for changes(run tests on save), use

    sbt ~test:compile

Explanation

The seed is a template that can be found here. It sets up a new sbt project with some sensible defaults.

Structure of the project:

   ├── build.sbt // contains settings for the build, for e.g. Scala version, project version and project name
   ├── project // build support files
   │   └── Dependencies.scala // lists dependencies
   │   └── build.properties // defines sbt version
   ├── target // temporary folder for build output
   └── src
       ├── main
       │   └── scala // Scala code goes here
       └── test
           └── scala // Scala tests go here

References