Using the SBT console

After starting SBT, one lands in the interactive mode or SBT shell. The shell allows for the issuing of different commands to drive SBT to test, execute, or do something else with the source code. The most important for our purposes are the following commands:

  • exit: Closes the SBT and exits into the Terminal shell
  • test: Runs all test suites in the current project (if there are any in the src/test/scala folder)

The next screenshot shows how SBT compiles and runs tests for Chapter 11, An Introduction to the Akka and Actor Models:

  • run: Runs the main class if there is a single main class in the project. This command will throw an exception in the case that it fails to detect the main class. If there are multiple main classes, the SBT will ask you to pick one of them to run. This behavior is represented by the following screenshot:

  • console: Starts scala REPL
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.255.140