Cats Sandbox
This repository contains an empty Scala/Cats project for use in Spacecat training courses.
Licensed Apache 2.0.
Getting Started
-
To use this repo you'll need to install a Java 11+ compatible JDK. We recommend using Sdkman to do this:
sdk list java sdk install java <VERSION_TAKEN_FROM_THE_LIST>
-
Clone this repository to a directory on your hard drive:
git clone https://github.com/spacecatio/cats-sandbox.git cd cats-sandbox
-
Run the
sbt.sh
script (or use your own locally installed SBT):./sbt.sh # Lots of output here. The first run will take a while. # You'll see an SBT prompt as follows: sbt:sandbox> run
-
Type
run
at the SBT prompt to run the sample app:sbt:sandbox> run # Lots of output here. The first run will take a while. # You should finally see the following output: Hello world!
-
Type
exit
to quit the SBT prompt when you're done:sbt:sandbox> exit
Editing Using Visual Studio Code
If you don't have a particular preference for a Scala editor or IDE, we recommend you use Visual Studio Code and a Linux or macOS terminal.
Ideally you should have the code
command set up in your terminal, in which case:
cd cats-sandbox
code .
If you don't have the command installed, you can open the code from the file menu:
- Choose File Menu > New Window
- Choose File Menu > Open Folder... and select the repo root folder
We recommend using your terminal to compile and run your code.
You can optionally install the Metals plugin to add IDE-like features for editing Scala in VSCode. However, please take the time to get this working correctly before your course.
Editing Using IntelliJ IDEA
If you prefer to edit Scala code using IntelliJ IDEA:
- Make sure you have the Scala plugin installed
- Choose File Menu > Open... and select the
build.sbt
file from the repo root folder - Choose "Open as Project"