Documentation on the development of the Scala compiler and standard library.

View the Project on GitHub scala/scala

More information


Run ant build-opt to build an optimized version of the compiler. Verify your build using ant test-opt.

The Scala build system is based on Apache Ant. Most required pre-compiled libraries are part of the repository (in 'lib/'). The following however is assumed to be installed on the build machine:



We ask all contributors sign the Scala Contributor License Agreement, which allows us to ensure that all code submitted to the project is unencumbered by copyrights or patents.

Please follow the guidelines outlined in our (Pull Request Policy)[].

Repository structure

+--build.xml                 The main Ant build script, see also under src/build.
+--lib/                      Pre-compiled libraries for the build.       Pulls binary artifacts from remote repository.
+--src/                      All the source files of Scala.
+--test/                     The Scala test suite.
+--build/                    [Generated] Build products output directory for ant.
+--dist/                     [Generated] The destination folder for Scala distributions.

Tips and tricks

Here are some common commands. Most ant targets offer a -opt variant that runs under -optimise.

Bootstrapping (soon to be legacy)

In order to guarantee the bootstrapping of the Scala compiler, SABBUS builds Scala in layers. Each layer is a complete compiled Scala compiler and library. A superior layer is always compiled by the layer just below it. Here is a short description of the four layers that SABBUS uses, from bottom to top:

SABBUS compiles, for each layer, the Scala library first and the compiler next. That means that any changes in the library can immediately be used in the compiler without an intermediate build. On the other hand, if building the library requires changes in the compiler, a new locker must be built if bootstrapping is still possible, or a new starr if it is not.

Use ant replacelocker to "unfreeze" locker by updating it to match the current source code.