Scala 存在不兼容的逐出时sbt生成失败
当检测到一些不兼容的库时,我希望使生成失败。我想出了这样的办法:Scala 存在不兼容的逐出时sbt生成失败,scala,sbt,Scala,Sbt,当检测到一些不兼容的库时,我希望使生成失败。我想出了这样的办法: test := Def.sequential( Def.task { if (evicted.value.reportedEvictions.nonEmpty) { throw new IllegalStateException("There are some incompatible classpath evictions warnings. You can suppress them with depe
test := Def.sequential(
Def.task {
if (evicted.value.reportedEvictions.nonEmpty) {
throw new IllegalStateException("There are some incompatible classpath evictions warnings. You can suppress them with dependencyOverrides setting.")
}
},
test in Test
).value
所以我重新定义测试失败,但它看起来有点设计过度。有更简单的解决方案吗?最好不创建自定义任务。我假设您使用的是sbt 1.x,因此我认为正确的方法是:
lazy val myTask = taskKey[Unit]("This is the tasks that checks that everything is ok before you start your tests")
myTask := ???
(test in Test) := (test in Test).dependsOn(myTask).value
sbt的哪个版本?