buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Boisvert <>
Subject Re: project.invoke is called before I had to chance to deal with it
Date Thu, 17 Sep 2009 17:18:25 GMT
I think the main concern is complexity.

In your case, project("bar") actually evaluates to
project("bar").artifacts.   We could evaluate this lazily but then we have
to decide when it's evaluated.  We could evaluate it after the buildfile has
been read... but then project("bar") would evaluate differently than
project("bar").artifacts because the later can't be lazily evaluated...
unless we introduce some kind of laziness contruct like passing a block to

So there are important ramifications to doing this and we would have to
carefully weigh the costs/benefits.  If this is something you feel strongly
about then perhaps a prototype implementation would be the best way to get
an accurate measure for the implementation and conceptual costs.

Can your example be rewritten to avoid this definition order issue?


On Thu, Sep 17, 2009 at 8:12 AM, Antoine Toulme <>wrote:

> Hi all,
> I have a case (oversimplified) like this:
> define "foo" do
>  compile.with project("bar")
> end
> Now if I do something like buildr clean, I get: No such project bar.
> The problem is that the error is thrown during the evaluation of the
> project
> task, because project("bar") invokes the project or raises an exception.
> This spec currently fails because the error is thrown line 2, not line 4:
> foo = define "foo" do
>  compile.with project("bar")
> end
> lambda { foo.compile.invoke }.should raise_error(RuntimeError, /No such
> project/)
> I would like to delay the invocation until the compile task calls its
> prerequisites.
> Is this something that can be achieved ? In general, what would be lost if
> project.invoke is not called ? Would we lose the project compilation order
> for example ?
> Thanks,
> Antoine

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