buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas Andrews <>
Subject Run tasks
Date Fri, 29 Jan 2010 03:15:30 GMT

I want to have several buildr run tasks.  My current run task looks like this:

task :run => :compile do "cc.HelloWorld", "arg1",
    :classpath => [ compile.dependencies, ],
    :java_args => ["-server", "-Xmx2048m"]

I thought I could just do:

task :run_with_blah to run with, say, "cc.ByeByeWorld" instead, but I
get a "don't know what to do with run_with_blah" error when I try to
run `buildr run_with_blah`.

The other thing I want is to be able to pass parameters to whatever it
is I'm running, instead of having to hard-code it in the build script.
 Can you access command line options from the buildfile script, or
does buildr eat them when it interprets it?  E.g.,

$ buildr run file1 file2

and use file1 and file2 as arguments to the class called in run.  This
could work for different main classes as well, where I'd just pass the
class name as an argument like

$ buildr run HelloWorld arg1 arg2

There may be a nicer way to accomplish what I'm doing here, for
instance with a testing framework.  I'd welcome any suggestions along
these lines too.


View raw message