buildr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Assaf Arkin" <ar...@intalio.com>
Subject Re: circular dependency
Date Wed, 16 Jul 2008 20:23:29 GMT
On Wed, Jul 16, 2008 at 4:40 AM, Ittay Dror <ittay.dror@gmail.com> wrote:

> Hi,
>
> I have the following build file:
> define 'proj' do
>  define 'A' do
>   project('B')
>  end
>
>  define 'B' do
>   project('A')
>  end
> end
>
>
> running buildr, i get the message:
> Circular dependency detected: TOP => proj:A => proj:B => proj:A
>
> this is done (i think) because the 'project' method invokes the project
> task. project('B') invokes 'B' which then has 'project('A')' which invokes
> A.
>
> is there a way to avoid this? (I actually need it to get properties from
> the project, it doesn't need to take any action)


If the properties of that project are unknown until it's defined, then you
have a classical circular dependency: the definition of A depends on the
definition of B which depends on the definition of A.

If the properties are not decided by the definition, then you can put the
outside, e.g. define a constant and access it from either definition.

Assaf


>
>
> thank you,
> ittay
>
> --
> --
> Ittay Dror <ittay.dror@gmail.com>
>
>
>

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