25 Mar 2017
Setting up multi-projects in SBT requires 2 wisdoms:
aggregatemeans that a task (e.g. compile) is performed in the main project as well as the subproject, while
dependsOnadds the subproject's class path to the main project.
Here's the main project's build.sbt:
lazy val root = (project in file(".")) .dependsOn(model) .aggregate(model) lazy val model = ProjectRef(file("model"), "model")
The subproject's build.sbt looks like this:
lazy val model = (project in file(".")) .settings(name := "model")
That's it. It works!