[sbt] Input task dependency on other tasks

153 views
Skip to first unread message

philcali

unread,
Jul 9, 2011, 2:00:33 PM7/9/11
to simple-build-tool
What is the correct idiom to define an input task that depends on
other tasks?

I've seen it done this way:

myInputTask <<= inputTask { (argTask: TaskKey[A]) =>
(argTask, mySetting, taskThatDepends, otherTaskThatDepends) map
{ (args, s, _, _) =>
// Do my special work
}
}

Where taskThatDepends and otherTaskThatDepends will be executed when
myInputTask is invoked. Standard tasks have the explicit dependsOn,
and I was wondering if there was such a thing for input tasks.

Thanks!

-- Philip Cali

Mark Harrah

unread,
Jul 9, 2011, 9:19:44 PM7/9/11
to simple-b...@googlegroups.com
On Sat, 9 Jul 2011 11:00:33 -0700 (PDT)
philcali <phili...@gmail.com> wrote:

> What is the correct idiom to define an input task that depends on
> other tasks?
>
> I've seen it done this way:
>
> myInputTask <<= inputTask { (argTask: TaskKey[A]) =>
> (argTask, mySetting, taskThatDepends, otherTaskThatDepends) map
> { (args, s, _, _) =>
> // Do my special work
> }
> }

This is fine. dependsOn is a convenience mainly for tasks that don't do any work themselves.

-Mark

Reply all
Reply to author
Forward
0 new messages