1

How do I make target "package" depend on target "test" ?

There is a solution here: Force sbt 0.11 to run tests But it doesn't really work with the xsbt-web-plugin.

Community
  • 1
  • 1
VasiliNovikov
  • 9,681
  • 4
  • 44
  • 62

1 Answers1

3

Here's what I did:

Keys.`package` <<= (test in Test, Keys.`package` in Compile) map { (_, in) =>
  println("after package & test")
  in
}

It runs test, and iff the tests were successful, runs package task. (tested on fresh install of lift-2.5-RC2)

Rogach
  • 26,050
  • 21
  • 93
  • 172
  • 1
    Thanks a lot! This solves the problem. BTW, looking at the solution I fount a shorter version that works too: Keys.`package` <<= (Keys.`package` in Compile) dependsOn (test in Test) – VasiliNovikov Mar 21 '13 at 13:36