Alexander Zhugastrov
Alexander Zhugastrov

Reputation: 13028

Disable aggregate for sbt custom task

How can I disable aggregate for a single custom task?

I tried to add the following to my build.sbt:

aggregate in myTaskName:= false

But it doesn't work as I expected - I've got this error:

~\build.sbt:1: error: not found: value myTaskName
aggregate in myTaskName:= false 

Upvotes: 2

Views: 1114

Answers (1)

dk14
dk14

Reputation: 22374

Working example (sbt 0.13.5):

val hello = TaskKey[Unit]("hello", "Prints 'Hello Zhu'")

val helloTask = hello := {
  println("Hello Zhu")
}

aggregate in hello := false

Note, that TaskKey was used - not the Setting[Task] itself. It worth additional notice that this key should be accessable from your build.sbt and, as @Mark Harrah mentioned, hello must be fully-qualified.

Upvotes: 4

Related Questions