concept build in category sbt

appears as: builds, build, builds, build, The build
sbt in Action

This is an excerpt from Manning's book sbt in Action.

But speed wasn’t the only reason we wanted a better build system; we also wanted reproducibility. If a build is reproducible, then it doesn’t matter if Bob builds the project and deploys it to the integration server or if Ted does it. It produces the same result. When the build was rewritten as described previously, it didn’t matter who did the final build. It didn’t matter what software was installed on the developer’s machine, which versions of the libraries they had, which version of Java they happened to have installed, and so on. If there was a problem with that version of the software, then we could reproduce exactly the build that had a problem, so we at least had a chance to fix the bug.

Later, at a different company, there was another automated build system. His name was Fred.[1] His job was to build the product, in all of its various combinations. Every day, he would come in, check out all of the sources, and enter the numerous commands to build the product. And then he’d do it again, with a slightly different combination for a slightly different version of the build. If any of the builds failed, it was his job to tell the developers that something went wrong. This was his job. Fred was an intelligent person and, frankly, he deserved better—and indeed he could have spent his time much better elsewhere. In fact, he ended up writing his own build system to automate the builds. And he could have saved the time taken to write and maintain that as well if he’d used a standard build tool.

sbt is a highly interactive tool, meant to be used during all stages of the development process. It provides interactive help and autocomplete for most services and promotes a type of autodiscovery for builds. Although you can use sbt as a command-line tool, it doesn’t really shine until you use its shell.

Throughout this book, you’ll be designing an sbt build for a sophisticated website called preowned-kittens.com that handles the resale of pet kittens. The website attempts to find ideal owners by matching buyer survey questions to known statistics of happy pet owners and behavior characteristics of the kittens. As you add features to the website, you’ll add new testing and debugging features to the build to ensure the entire preowned-kittens.com team is able to work effectively.

> tasks

This is a list of tasks defined for the current project.
It does not list the scopes the tasks are defined in; use the 'inspect' command for that.

Tasks produce values. Use the 'show' command to run the task and print the resulting value.

  clean            Deletes files produced by the build ...
  compile          Compiles sources.
  console          Starts the Scala interpreter with the ...
  consoleProject   Starts the Scala interpreter with the sbt ...
  consoleQuick     Starts the Scala interpreter with the ...
  copyResources    Copies resources to the output directory.
  doc              Generates API documentation.
  package          Produces the main artifact, such as a ...
  packageBin       Produces a main artifact, such as a ...
  packageDoc       Produces a documentation artifact, such ...
  packageSrc       Produces a source artifact, such as a ...
  publish          Publishes artifacts to a repository.
  publishLocal     Publishes artifacts to the local repository.
  run              Runs a main class, passing along args ...
  runMain          Runs the main class selected by arg ...
  test             Executes all tests.
  testOnly         Executes the tests provided as arguments ...
  testQuick        Executes the tests that either failed ...
  update           Resolves and optionally retrieves ...

More tasks may be viewed by increasing verbosity. See 'help tasks'.

These files configure the version of sbt used for the build and set the name and version of the project itself. We’ll cover the syntax of these settings in more detail later. For now, type this code into your editor and get a feel for sbt in action.