On Mon, Jan 11, 2010 at 7:49 PM, Nicholas Andrews <[email protected]>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
