Chapter 21. Scala Tools and Libraries

This chapter fills in some details about the Scala tools we’ve already used, such as the compiler scalac and the REPL scala. We’ll discuss build tool options and IDE and text editor integration, and look at testing libraries for Scala. Finally, we’ll list some of the popular third-party Scala libraries you might find useful.

Command-Line Tools

Even if you do most of your work with IDEs or the SBT REPL, understanding how the command-line tools work gives you additional flexibility, as well as a fallback should the graphical tools fail you. Most of the time, you’ll configure compiler flags through your SBT build files or IDE settings, and you’ll invoke the REPL through your SBT session, using the console command.

“Installing Scala” described how to install the command-line tools. All of them are located in the SCALA_HOME/bin directory, where SCALA_HOME is the directory where you installed Scala.

You can read more information about the command-line tools at http://www.scala-lang.org/documentation/.

scalac Command-Line Tool

The scalac command compiles Scala source files and generates JVM class files.

The scalac command is just a shell-script wrapper around the java command, passing it the name of the Scala compiler’s Main object. It adds Scala JAR files to the CLASSPATH and it defines several Scala-related system properties.

You invoke scalac like this:

scalac <options> <source files>

Recall from “A Taste of Scala” that source file names don’t ...

Get Programming Scala, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.