dantb / cats-sandbox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cats Sandbox

This repository contains an empty Scala/Cats project for use in Spacecat training courses.

Licensed Apache 2.0.

Getting Started

  1. 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>
  2. Clone this repository to a directory on your hard drive:

    git clone https://github.com/spacecatio/cats-sandbox.git
    cd cats-sandbox
  3. 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
  4. 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!
  5. 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:

  1. Choose File Menu > New Window
  2. 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:

  1. Make sure you have the Scala plugin installed
  2. Choose File Menu > Open... and select the build.sbt file from the repo root folder
  3. Choose "Open as Project"

About


Languages

Language:Scala 86.2%Language:Shell 7.4%Language:Batchfile 6.4%