我正在维护一些与此双层解决方法类似的代码:
import AssemblyKeys._
lazy val assemblySettings: Seq[sbt.Project.Setting[_]] = baseAssemblySettings
implicit def wrapTaskKey[T](key: TaskKey[T]): WrappedTaskKey[T] = WrappedTaskKey(key)
case class WrappedTaskKey[A](key: TaskKey[A]) {
def orr[T >: A](rhs: Initialize[Task[T]]): Initialize[Task[T]] =
(key.? zipWith rhs)( (x,y) => (x :^: y :^: KNil) map Scoped.hf2( _ getOrElse _ ))
}
lazy val baseAssemblySettings: Seq[sbt.Project.Setting[_]] = Seq(
test <<= test orr (test in Test).identity,
test in assembly <<= (test in Test).identity,
)
(从这里)。
我应该如何完全删除此解决方法的两个“层”,因为在 sbt >= 0.12 中显然不再需要它们?