On Mon, Jan 5, 2009 at 2:10 PM, Daniel Spiewak <[email protected]> wrote:
> I like the idea of an ENV and I *really* like the idea of invocation-point
> selection (buildr myproject:shell:jirb). How can this be done? I know how
> to declare a task relevant to a project, but how do I setup the :jirb
> subtask?
The following works but feels a little hackish...
module Shell
include Extension
first_time do
desc 'start an interactive shell with compile+test classpath of project'
Project.local_task('shell')
end
before_define do |project|
# define a couple of tasks ...
Rake::Task.define_task 'shell:jirb' do |name|
puts "Running jirb for #{name}"
end
Rake::Task.define_task 'shell:scala' do |name|
puts "Running scala for #{name}"
end
end
after_define do |project|
# figure out which shell should be default
task 'shell' => 'shell:jirb'
end
end
alex