4. Set up your project locally
In this section we will setup the project development environment on your own computer. This is the part of the tutorial with the greatest potential for stumbling-blocks, because it involves the installation of software.
If you do run into any difficulties, don’t hesitate to contact support, who will be glad to help you out.
After everything has been setup, you will be able to run the unit test that are included locally.
4.1 Install scala
If you are using Windows we assume you are using WSL 2.
- Simple
- Manage Scala versions
- Advanced
If you do not know what to install (JVM, scala, sbt) the simplest way is to use the scala installer. It will install all the necessary components for you.
Scala installer: https://get-coursier.io/docs/cli-installation
If you need to manage multiple java/scala versions on your laptop and want to have more control over what to install, we recommend using sdkman. Sdkman is supported on linux/macos and on windows with wsl support.
After the installation of sdkman, for this tutorial you must install the following:
Java (8 or 11):
sdk install java 8.0.352-amzn
You can check whether there are more recent hotfixes for java 8 or 11 by running:
sdk list java
Scala 2.12 (since we created the project for this version)
sdk install scala 2.12.15
If you know what you are doing and prefer not to use either of the suggested approaches, you can look at other ways to install scala https://www.scala-lang.org/download/scala2.html
Verify your installation
Make sure that you can run the following commands and they return the expected versions:
scala -version
java -version
4.2 (optional) Install gradle
You can either install gradle locally or use the gradlew executable packaged with the project.
sdk install gradle 7.12
4.3 Run the tests
From the root directory of your project run the following command
./gradlew test
Your project development environment is now setup, you are ready to roll.