sbt 0.12 build.sbt
val myTask = TaskKey[Unit]("mytask")
lazy val baseSettings = Seq(
javacOptions ++= Seq("-g", "-encoding", "utf8")
)
lazy val appSettings = baseSettings ++ Seq(
myTask <<= (fullClasspath in Runtime, normalizedName, target, packageOptions, streams, cacheDirectory) map {
case (fullClasspath: Classpath, normalizedName: String, target: File, packageOptions: Seq[PackageOption], streams: TaskStreams, cacheDirectory: File) => {
streams.log.info("my task appSettings")
}
}
)
Хотите обновить следующий код до sbt 1.x
myTask <<= (fullClasspath in Runtime, normalizedName, target, packageOptions, streams, cacheDirectory) map {
case (fullClasspath: Classpath, normalizedName: String, target: File, packageOptions: Seq[PackageOption], streams: TaskStreams, cacheDirectory: File) => {
Спасибо
Update:
I find some information at scala-sbt.org/0.13/docs/Migrating-from-sbt-012x.html, but I don't know how to use ":=" with "case"
EDIT:
Mateusz Kubuszok is right, not need "case", and "cacheDirectory" can be replaced by "streams.value.cacheDirectory"