buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ittay Dror <ittay.d...@gmail.com>
Subject Re: buildfile per component
Date Mon, 30 Jun 2008 04:56:32 GMT



Assaf Arkin wrote:
> 
> [SNIP]
>>>
>>> Buildr looks for the buildfile in the current directory (up the tree
>>> if there's none in the current directory), so inside foo you would
>>> only get foo's buildfile to load.  At that point, you're like every
>>> other component developer who only sees one buildfile and not the
>>> entire set.
>>>
>>> Assaf
>>>
>>
>> can I reference 'bar' as a dependency? usually this is done with
>> 'project()', but if i build in 'foo', then 'bar' is unknown. in maven,
>> since
>> a dependency is always via group,artifact,version ids, it does not
>> matter,
>> as long as 'bar' is in the local repository. how can i get the same
>> behavior
>> in buildr?
> 
> You don't change the buildfile.  If right now foo's buildfile
> references bar by its artifact specification, it keeps doing the same
> thing.
> 
> When you use the project reference it also references the artifact by
> its specification, it's just a very convenient shortcut which you can
> use inside, but not across buildfiles.
> 
> Assaf
> 
Which was what I was pointing to: I have modules foo and bar, foo depends on
bar. If I write a single buildfile, then in foo's define I can reference bar
with 'project(bar)'. If I split the build file so there are root/buildfile,
root/foo/buildfile, root/bar/buildfile and build from root, everything works
the same. But if I just want to build 'foo', I cd to foo and then buildr
will pickup only root/foo/buildfile. Then, when it sees 'project("bar")' it
will trigger an error, because it doesn't know bar (at least that is what I
understand from looking at the source code).

So root/bar/buildfile should be evaluated also. 

There are two ways that I think of:
1. the "user" way: rename root/foo/buildfile and root/bar/buildfile to
root/foo/buildfile.sub and root/bar/buildfile.sub. then when building in foo
builr will still read the file from root/buildfile
2. the "framework" way: when referencing an unknown project, try to search
the directories for a directory with the same name as the project and read
the buildfile from there. this means buildr needs to know the root from
which to search, maybe by requiring a root.buildr file to be placed there.
then, if in root/foo/buildfile, buildr sees 'project("bar")', it will try to
read root/bar/buildfile, finding the definition of bar there and all is well

The second way is better for complex projects since it requires reading only
those projects that are required as dependencies by the project that is
currently being built.

Unfortunately, I do not yet know enough Ruby / Rake / Buildr to try to
attempt this change myself.

Ittay


Assaf Arkin wrote:
> 
>>
>> thanks,
>> ittay
>>
>>
>> Assaf Arkin wrote:
>>>
>>>
>>>>
>>>>
>>>>
>>>> Assaf Arkin wrote:
>>>>>
>>>>>
>>>>>>
>>>>>> Thank you,
>>>>>> Ittay
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/buildfile-per-component-tp18107287p18107287.html
>>>>>> Sent from the Buildr - User mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/buildfile-per-component-tp18107287p18167540.html
>>>> Sent from the Buildr - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/buildfile-per-component-tp18107287p18185612.html
>> Sent from the Buildr - User mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/buildfile-per-component-tp18107287p18188699.html
Sent from the Buildr - User mailing list archive at Nabble.com.


Mime
View raw message