SBT“包装"取决于“测试" [英] SBT "package" depend on "test"

查看:98
本文介绍了SBT“包装"取决于“测试"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使目标包装"取决于目标测试"?

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

这里有一个解决方案:强制sbt 0.11运行测试 但这实际上不适用于xsbt-web-plugin.

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

推荐答案

这就是我所做的:

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

它运行测试,如果测试成功,则运行包任务. (已在新安装的Lift-2.5-RC2上进行了测试)

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

这篇关于SBT“包装"取决于“测试"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆