In sbt 0.12, you could specify that one task depended upon another without actually using the output from the input tasks. So you were specifying purely an ordering on the tasks:
unitTask <<= Seq(stringTask, sampleTask).dependOn
There is no such example in the Tasks documentation for sbt 0.13. What's the new syntax for specifying said dependency?
Use the standard syntax, but ignore the results of the tasks used:
unitTask := {
val x = stringTask.value
val y = sampleTask.value
()
}
Because of a bug in scalac, you have to use dummy names, otherwise you could just use val _ = ...
.
Also, I prefer the more explicit way above, but it is equivalent to this shorter version because the results aren't used:
unitTask := {
stringTask.value
sampleTask.value
}
The official migration guide recommends that instead of:
a <<= a dependsOn b
define it as:
a := (a dependsOn b).value
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With