Re: Creating a filesystem task with lib dependencies

9 views
Skip to first unread message

Alexey Lunacharsky

unread,
Dec 12, 2012, 10:56:49 PM12/12/12
to simple-b...@googlegroups.com
Hi, Petri.

You should specify dpendencies for the build definition under the project/build.sbt.
Then you should be able to use them from project/Build.scala classes on usual basis, just as in other scala programs. (see http://www.scala-sbt.org/release/docs/Getting-Started/Full-Def.html)

For the second question read http://www.scala-sbt.org/release/docs/Detailed-Topics/TaskInputs.html
and use dependency on "target" build setting, which holds a File reference to the target build directory.

четверг, 13 декабря 2012 г., 4:30:35 UTC+7 пользователь Petri Kivikangas написал:
I've now spent hours trying to access libraries inside a task definition. I have a simple task where I want to do some file operations using Apache Commons IO. I don't want to create any plugins, only one simple (in my opinion) task. I have project definition and dependencies in build.sbt, and task definition in project/build.scala. However, my build.scala is currently a mess, because I don't have any clue about the correct approach.

So, in build.scala I want to access several classes under "org.apache.commons". How do I make this happen?

Also, I want to find the absolute path to project's root directory and 'target' directory, because I need these in the file operations. I'm sure sbt has these paths somewhere, but how do I get them as simple strings or File objects?
Reply all
Reply to author
Forward
0 new messages