In the previous lesson, you learned how to evaluate snippets of code using the Scala REPL. Programs have several components: they depend on other modules and libraries, and they are structured in multiple files and folders. In this lesson, you’ll discover the basics of the Scala Build Tool, sbt. You’ll compile and run your first Scala program on the JVM using sbt. In this book, you’ll use sbt to manage dependencies, compile your code, and run your Scala programs.
You can build Scala projects using several build tools such as Maven, Ant, and Gradle, but sbt is the most common build tool in the community. It is a complex but powerful tool that manages your dependencies, and it defines the build cycle of your code. sbt has its syntax and predefined instructions. You can also load plugins, which are programs written using the sbt syntax, to add new commands or modify the build process’s existing behaviors. Throughout this book, you are going to write Scala programs that use the default sbt configuration. You are not going to learn about its advance uses and functionalities in this book, but you can look at its documentation at www.scala-sbt.org if you’d like to learn more about it.