In my build.sbt file I have two custom tasks:
TaskKey[Unit]("aaa") := {
println("aaa")
}
TaskKey[Unit]("bbb") := {
println("bbb")
}
How do I add a dependency between them? For example, I want aaa to depend on bbb.
From https://github.com/harrah/xsbt/wiki/Tasks
To depend on the side effect of some tasks without using their values and without doing additional work, use dependOn on a sequence of tasks. The defining task key (the part on the left side of <<=) must be of type Unit, since no value is returned.
unitTask <<= Seq(stringTask, sampleTask).dependOn
To add dependencies to an existing task without using their values, call dependsOn on the task and provide the tasks to depend on. For example, the second task definition here modifies the original to require that string-task and sample-task run first:
intTask := 4
intTask <<= intTask.dependsOn(stringTask, sampleTask)
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