You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@buildr.apache.org by lacton <la...@users.sourceforge.net> on 2008/07/16 22:48:04 UTC

[buildr] How to debug?

Hi,

I want to debug (i.e., run step-by-step) buildr, but it seems I'm
missing something important. Will you tell me how to do it?

Here's what I tried.

<code>
require 'rubygems'
load File.join(File.dirname(__FILE__), '../../lib/buildr.rb')

load File.join(File.dirname(__FILE__), 'buildfile')

task('simple_java_project:package').invoke
</code>

Although I can step through the Project.define method when 'buildfile'
is loaded, nothing happens afterwards. The jar package is not created.

Regards.

Lacton

Re: [buildr] How to debug?

Posted by lacton <la...@users.sourceforge.net>.
Thanks Assaf. 'Buildr.application.run' was exactly what I needed. Now,
it works like a charm.

Have a nice day.

Lacton

On Thu, Jul 17, 2008 at 3:13 AM, Assaf Arkin <ar...@intalio.com> wrote:
> On Wed, Jul 16, 2008 at 1:48 PM, lacton <la...@users.sourceforge.net>
> wrote:
>
>> Hi,
>>
>> I want to debug (i.e., run step-by-step) buildr, but it seems I'm
>> missing something important. Will you tell me how to do it?
>>
>> Here's what I tried.
>>
>> <code>
>> require 'rubygems'
>> load File.join(File.dirname(__FILE__), '../../lib/buildr.rb')
>>
>> load File.join(File.dirname(__FILE__), 'buildfile')
>>
> Buildr.application.run
>
>
>> task('simple_java_project:package').invoke
>> </code>
>>
>
> I didn't use it myself, but if you want true step-by-step and breakpoints,
> you can try ruby-debug:
> http://rubyforge.org/projects/ruby-debug/
>
> Then just add:
>
>  require 'ruby-debug' ; Debugger.start
>
> at the top of the buildfile, and call debugger whenever you want a
> breakpoint.
>
> Assaf
>
>
>>
>> Although I can step through the Project.define method when 'buildfile'
>> is loaded, nothing happens afterwards. The jar package is not created.
>>
>> Regards.
>>
>> Lacton

Re: [buildr] How to debug?

Posted by Assaf Arkin <ar...@intalio.com>.
On Wed, Jul 16, 2008 at 1:48 PM, lacton <la...@users.sourceforge.net>
wrote:

> Hi,
>
> I want to debug (i.e., run step-by-step) buildr, but it seems I'm
> missing something important. Will you tell me how to do it?
>
> Here's what I tried.
>
> <code>
> require 'rubygems'
> load File.join(File.dirname(__FILE__), '../../lib/buildr.rb')
>
> load File.join(File.dirname(__FILE__), 'buildfile')
>
Buildr.application.run


> task('simple_java_project:package').invoke
> </code>
>

I didn't use it myself, but if you want true step-by-step and breakpoints,
you can try ruby-debug:
http://rubyforge.org/projects/ruby-debug/

Then just add:

  require 'ruby-debug' ; Debugger.start

at the top of the buildfile, and call debugger whenever you want a
breakpoint.

Assaf


>
> Although I can step through the Project.define method when 'buildfile'
> is loaded, nothing happens afterwards. The jar package is not created.
>
> Regards.
>
> Lacton
>