Knows Not Much
Knows Not Much

Reputation: 31546

How to make an existing task depend on a custom task

I am writing a custom task in SBT. I want the existing task of "test" depend on my custom task.

Basically, I want my custom task to execute just before someone calls "test" on my project.

How can I do this?

Upvotes: 1

Views: 67

Answers (1)

Martin
Martin

Reputation: 2028

You can redefine test so that is depends on your task:

lazy val foo = taskKey[Unit]("...")
foo := println("Hello, world!")
test <<= test in Test dependsOn foo

Upvotes: 1

Related Questions