buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Spiewak" <djspie...@gmail.com>
Subject Re: Interactive Shell Support
Date Mon, 05 Jan 2009 22:55:03 GMT
Assaf's parametrized idea seems like the "proper" way to do this, but I
don't like the syntax.  At least to my eye, shell:jirb is *much* nicer and
more consistent with the "Buildr philosphy" than shell[jirb].  Besides, the
former is marginally easier to type.

We could use your multiple-tasks idea without too much hardship in the
implementation.  I've got all the providers in a Hash, so a simple .each {
|lang, prov| define_task ... } should be sufficient.  I'm fine with doing it
this way as long as y'all are ok with it.  :-)

Daniel

On Mon, Jan 5, 2009 at 4:45 PM, Alex Boisvert <boisvert@intalio.com> wrote:

> 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