heroku/heroku-buildpack-scala — pull request #54 by naaman (2013-12-09 06:28:07+00:00)
Title: Incremental Compilation

Incremental compilation provides a speed boost to Scala builds. It compiles fewer classes and removes unnecessary resolution on each build. In order to achieve incremental compilation, the `target`, `project/target`, and `project/boot` are cached. A static temp folder, `/tmp/scala_buildpack_build_dir`, is used to keep absolute paths the same between builds.

As a result, an incremental compilation generally fully completes in under a minute. The build output looks like this:

```
-----> Fetching custom tar buildpack... done
-----> Scala app detected
-----> Installing OpenJDK 1.6...done
-----> Running: sbt compile stage
[info] Loading project definition from /tmp/scala_buildpack_build_dir/project
[warn] Multiple resolvers having different access mechanism configured with same name 'typesafe-ivy-releases'. To avoid conflict, Remove duplicate project resolvers (`resolvers`) or rename publishing resolver (`publishTo`).
[info] Set current project to scala_buildpack_build_dir (in build file:/tmp/scala_buildpack_build_dir/)
[success] Total time: 0 s, completed Dec 7, 2013 12:12:44 AM
[info] Wrote start script for mainClass := Some(com.example.Boot) to /tmp/scala_buildpack_build_dir/target/start
[success] Total time: 0 s, completed Dec 7, 2013 12:12:44 AM
-----> Discovering process types
Procfile declares types -> web

-----> Compiled slug size: 139.8MB
-----> Launching... done, v8
http://gentle-mesa-2323.herokuapp.com deployed to Heroku
```

@sclasen @ryanbrainard @jamesward One open question around incremental compiles is that it no longer `clean`s. What's your feeling about having an option to clean? Should we add something to `system.properties`, or use another mechanism, such as adding to `project/build.properties`?