简体   繁体   中英

sbt multi-project build with test dependency between projects?

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM