You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Victor Hugo Borja <vi...@gmail.com> on 2008/04/14 18:18:49 UTC

Buildr#project given a block

I'm just wondering, what would you think of having the Buildr#project method
to optionally take a block, if provided it will just act as #define
currently does.
Reason behind this is that it seems (IMHO) a bit more natural to say
"project('cool') { ..stuff.. }'

   define('foo') do
        define('bar') do
            compile.with project('foo')
        end
   end

should be equivalent to:

   project('foo') do # providing a block is a project definition
        project('bar') do
            compile.with project('foo') # without block is just a reference,
just like it currently is.
        end
   end

In code terms this would be a minor change, and should not introduce
incompatibilities with ~>1.2 buildfiles.
Of course the #define method will stay, at least for 1.3 series.

What you guys think about this.

-- 
vic

Quaerendo invenietis.

Re: Buildr#project given a block

Posted by Harish Krishnaswamy <ha...@gmail.com>.
+1. From a user's perspective, I think its more intuitive. And, the API is a
bit more cleaner...

On Mon, Apr 14, 2008 at 12:18 PM, Victor Hugo Borja <vi...@gmail.com>
wrote:

> I'm just wondering, what would you think of having the Buildr#project
> method
> to optionally take a block, if provided it will just act as #define
> currently does.
> Reason behind this is that it seems (IMHO) a bit more natural to say
> "project('cool') { ..stuff.. }'
>
>   define('foo') do
>        define('bar') do
>            compile.with project('foo')
>        end
>   end
>
> should be equivalent to:
>
>   project('foo') do # providing a block is a project definition
>        project('bar') do
>            compile.with project('foo') # without block is just a
> reference,
> just like it currently is.
>        end
>   end
>
> In code terms this would be a minor change, and should not introduce
> incompatibilities with ~>1.2 buildfiles.
> Of course the #define method will stay, at least for 1.3 series.
>
> What you guys think about this.
>
> --
> vic
>
> Quaerendo invenietis.
>

Re: Buildr#project given a block

Posted by Alex Boisvert <bo...@intalio.com>.
I like it but the back of my mind keeps wondering when it's going to hit us
back in the head ;)

alex

On Mon, Apr 14, 2008 at 9:18 AM, Victor Hugo Borja <vi...@gmail.com>
wrote:

> I'm just wondering, what would you think of having the Buildr#project
> method
> to optionally take a block, if provided it will just act as #define
> currently does.
> Reason behind this is that it seems (IMHO) a bit more natural to say
> "project('cool') { ..stuff.. }'
>
>   define('foo') do
>        define('bar') do
>            compile.with project('foo')
>        end
>   end
>
> should be equivalent to:
>
>   project('foo') do # providing a block is a project definition
>        project('bar') do
>            compile.with project('foo') # without block is just a
> reference,
> just like it currently is.
>        end
>   end
>
> In code terms this would be a minor change, and should not introduce
> incompatibilities with ~>1.2 buildfiles.
> Of course the #define method will stay, at least for 1.3 series.
>
> What you guys think about this.
>
> --
> vic
>
> Quaerendo invenietis.
>