sbt 0.12:
Add the following parameters to the project settings:
(test in Test) <<= (test in Test) dependsOn (Keys.`package` in Compile)
This changes the test task for your project. But you can also define your own task:
val myTestTask = TaskKey[Unit]("my-test-task", "runs package and then test")
And then add this to your project settings:
myTestTask <<= (test in Test) dependsOn (Keys.`package` in Compile)
sbt 0.13:
Add the following parameters to the project settings:
(test in Test) := { (Keys.`package` in Compile).value (test in Test).value }
This changes the test task for your project. But you can also define your own task:
val myTestTask = taskKey[Unit]("runs package and then test")
And then add this to your project settings:
myTestTask := { (Keys.`package` in Compile).value (test in Test).value }
Christian
source share