You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Nicholas Andrews <no...@gmail.com> on 2010/01/12 01:49:52 UTC

Run task dependencies

Hi!

I am new to buildr and have a best practice question.  My Scala
project has several dependencies, which are also required when running
the project.  For instance:

'org.scala-lang:scala-library:jar:2.7.7'

The Quick Start gives an example of how to run using a task :run definition:

task :run => :compile do
    system 'java -cp CLASSPATH ...'
end

The classpath will need to include many of the same dependencies as
the compilation task, but the format string is not quite the same.  Is
there an easy way to map the compile.with dependencies to something
'java -cp' will understand?  Or even better some automagic way to have
run tasks pick this up?

Cheers,
Nick

Re: Run task dependencies

Posted by Alex Boisvert <al...@gmail.com>.
On Mon, Jan 11, 2010 at 7:49 PM, Nicholas Andrews <no...@gmail.com>wrote:

> I am new to buildr and have a best practice question.  My Scala
> project has several dependencies, which are also required when running
> the project.  For instance:
>
> 'org.scala-lang:scala-library:jar:2.7.7'
>
> The Quick Start gives an example of how to run using a task :run
> definition:
>
> task :run => :compile do
>    system 'java -cp CLASSPATH ...'
> end
>
> The classpath will need to include many of the same dependencies as
> the compilation task, but the format string is not quite the same.  Is
> there an easy way to map the compile.with dependencies to something
> 'java -cp' will understand?  Or even better some automagic way to have
> run tasks pick this up?
>

Yes.

Java.java "com.example.Main",
  :classpath => [ compile.dependencies, compile.target ],
  :java_args => ["-server", "-Xmx1024m"]

And an actual Buildfile<http://github.com/aboisvert/stopwatch/blob/master/Buildfile>
.

alex