sbt tasks and task evaluation

64 views
Skip to first unread message

confused

unread,
Jun 14, 2011, 11:44:34 AM6/14/11
to simple-build-tool
Hi, I'm new to sbt and scala in general, and I'm trying to play around
with full configurations and tasks.

One thing that I'd like to do is take a built-in task (for instance,
the 'sources' task), evaluate it when my custom task is called, and
then print the result. I was able to do this kind of thing in a
command by copying some code from the github wiki, but I'd like to do
it in a task. Currently, I'm having trouble supplying the
Project.evaluateTask method with a state--I don't really understand
how to handle states, or what their significance is.

Any help would be appreciated.

Mark Harrah

unread,
Jun 14, 2011, 7:23:09 PM6/14/11
to simple-b...@googlegroups.com

You only want to use evaluateTask from a Command. Fred has a good example of what you describe (but you have to replace 'sources' with 'sources in Compile':

https://gist.github.com/1024681

-Mark

Reply all
Reply to author
Forward
0 new messages