sbt multi-project build with test dependency between projects?

sbt, scala

Solution

You can say something like this: `foo % "test->test"`. This means test depends on test. You can have various other options like `foo % "test->test;compile->compile"` which means it depends not only on test but also on compile (compile -> compile). You can also have test depend on compile `foo % "test->compile"` and so on. It's described well here in documentation.

Problem

Say I have ``` lazy val foo = Project( id = "foo", base = file("foo") ) lazy val bar = Project( id = "bar", base = file("bar") dependencies = Seq(foo) // only want that for `% "test"`.... ) ``` How can I change `bar` so that it only depends on foo in the test scope?

Original source