buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Boisvert" <boisv...@intalio.com>
Subject Re: Interactive Shell Support
Date Mon, 05 Jan 2009 22:45:40 GMT
On Mon, Jan 5, 2009 at 2:10 PM, Daniel Spiewak <djspiewak@gmail.com> 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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message