This page is no longer maintained — Please continue to the home page at

Sbt compiles scala files in the base directory even though scalaSource points to a sub directory.

No replies
Joined: 2010-02-28,
User offline. Last seen 42 years 45 weeks ago.
My ant build script depends on several custom tasks defined in Scala. I simply keep those files in the base dir and never had any problem with that.
However sbt allows Scala code as a part of a script, so I decided to give sbt a try. Now my custom scala tasks in the base directory are compiled along with my sources and contaminate the rest of the build. Of course I will be removing those files eventually, but the thought of the build tool compiling something its not supposed to makes me very uneasy.
scalaSource is set in build.sbt as follows:
scalaSource in Compile <<= baseDirectory(_ / "src")
Why does sbt insist on compiling content of the baseDirectory when scalaSource is set? This is a highly undesirable behavior.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland