buildr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ittay Dror <ittay.d...@gmail.com>
Subject Re: circular dependency
Date Thu, 17 Jul 2008 04:01:22 GMT


Assaf Arkin wrote:
> 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.
>   
they each depend on the *act* of definition, that is, that a task is 
invoked. if 'define' was just analogous to 'new', things would work. 
putting the properties outside will break the nice modularization.
> 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>
>>
>>
>>
>>     
>
>   

-- 
--
Ittay Dror <ittay.dror@gmail.com>


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