sbt build.
cherry-pick of https://github.com/lrytz/scala/commit/7f5a93999a

This fix is necessary for the scala backend.