You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by lacton <la...@users.sourceforge.net> on 2009/11/01 23:06:16 UTC

Re: Question about Organizing Directories for projects

Hi,

Yes, you can use this directory structure.  In fact, that would be the
most conventional way of doing it.

Could you show us more of the buildfile you are using?

Lacton

On Sat, Oct 31, 2009 at 4:40 AM, Babu Naidu <pb...@gmail.com> wrote:
> Hi,
>
> I am using 1.3.5 version of Buildr and I have following directory structure.
>
> Root/
>     buildfile
>     /subporject-A
>              /the-api/src/main/java
>              /the-impl/src/main/java
>    /subproject-B
>
> My buildfile looks like
>
> define "Root" do
>    define "subproject-A"
>        define "the-api"
>            .....
>        end
>        define "the-impl"
>               .......
>        end
>    end
>    define "subject-B"
>          ........
>     end
> end
>
> Is it possible to organize like that? does it work? I tried, however when I
> execute buildr at "Root", it only runs build for subproject-A/the-api and
> stops.
> What am I doing wrong here?
>
> Any help is greatly appreciated.
>
> Thanks
> Babu
>

Re: Bug in linking additional test-folder?

Posted by Peter Schröder <ps...@blau.de>.
thx

Am 03.11.2009 um 16:42 schrieb Alex Boisvert:

> Hi Peter,
>
> I can reproduce the issue and I'll file it in Jira as soon as it's  
> available
> <sigh>.
>
> My guess is the classpath isn't set up correctly before RJB is
> initialized... I'll look deeper into it today.
>
> alex
>
>
> On Mon, Nov 2, 2009 at 6:02 AM, Peter Schröder <ps...@blau.de> wrote:
>
>> Hi,
>>
>> I am experiencing a strange behavior of buildr when having an empty
>> test-folder.
>>
>> See the example in the attachment, and look into the readme.txt for
>> the problem.
>>
>> Kind regards
>> Peter
>>
>>


Re: Bug in linking additional test-folder?

Posted by Alex Boisvert <al...@gmail.com>.
Hi Peter,

I can reproduce the issue and I'll file it in Jira as soon as it's available
<sigh>.

My guess is the classpath isn't set up correctly before RJB is
initialized... I'll look deeper into it today.

alex


On Mon, Nov 2, 2009 at 6:02 AM, Peter Schröder <ps...@blau.de> wrote:

> Hi,
>
> I am experiencing a strange behavior of buildr when having an empty
> test-folder.
>
> See the example in the attachment, and look into the readme.txt for
> the problem.
>
> Kind regards
> Peter
>
>

Re: Bug in linking additional test-folder?

Posted by Alex Boisvert <al...@gmail.com>.
Ok, I've gone ahead and implemented dependency/ordering between extensions
(before_define / after_define)* à la Rake*.

https://svn.apache.org/viewvc?view=revision&revision=833791

alex

On Thu, Nov 5, 2009 at 7:44 AM, Alex Boisvert <al...@gmail.com>wrote:

> (Moving to dev@)
>
> This issue is due to how extensions are handled.
>
> The Test module (which is an extension) adds test.compile.target to the
> classpath:
>
> # lib/buildr/core/test.rb
> after_define do |project|
>   ...
>   test.dependencies.concat [test.compile.target,
> test.resources.target].compact
>   ...
> end
>
> but Peter's custom extension is run only after so the change to
> test.compile.from (which affects the value of test.compile.target) isn't
> taken into account:
>
> after_define do |project|
>   project.test.compile.from project._(:src, 'test-functional', :java)
> end
>
> and thus when JUnit runs the classpath is incorrect and it's too late to
> fix anything since the classpath must be defined early for RJB to accept it.
>
> I've come across the same kind of issue with Eclipse extensions as well...
> and I think we need a way to define dependencies/ordering between extensions
> so we can properly compose them.  Maybe we could borrow the same notation
> from task dependencies?  e.g.,
>
> after_define(:test => :my_extension)
>
> after_define(:my_extension) do |project|
>   ...
> end
>
> Thoughts?  Any better ideas?
>
> alex
>
> On Mon, Nov 2, 2009 at 6:02 AM, Peter Schröder <ps...@blau.de> wrote:
>
>> Hi,
>>
>> I am experiencing a strange behavior of buildr when having an empty
>> test-folder.
>>
>> See the example in the attachment, and look into the readme.txt for
>> the problem.
>>
>> Kind regards
>> Peter
>>
>>
>

Re: Bug in linking additional test-folder?

Posted by Alex Boisvert <al...@gmail.com>.
(Moving to dev@)

This issue is due to how extensions are handled.

The Test module (which is an extension) adds test.compile.target to the
classpath:

# lib/buildr/core/test.rb
after_define do |project|
  ...
  test.dependencies.concat [test.compile.target,
test.resources.target].compact
  ...
end

but Peter's custom extension is run only after so the change to
test.compile.from (which affects the value of test.compile.target) isn't
taken into account:

after_define do |project|
  project.test.compile.from project._(:src, 'test-functional', :java)
end

and thus when JUnit runs the classpath is incorrect and it's too late to fix
anything since the classpath must be defined early for RJB to accept it.

I've come across the same kind of issue with Eclipse extensions as well...
and I think we need a way to define dependencies/ordering between extensions
so we can properly compose them.  Maybe we could borrow the same notation
from task dependencies?  e.g.,

after_define(:test => :my_extension)

after_define(:my_extension) do |project|
  ...
end

Thoughts?  Any better ideas?

alex

On Mon, Nov 2, 2009 at 6:02 AM, Peter Schröder <ps...@blau.de> wrote:

> Hi,
>
> I am experiencing a strange behavior of buildr when having an empty
> test-folder.
>
> See the example in the attachment, and look into the readme.txt for
> the problem.
>
> Kind regards
> Peter
>
>

Bug in linking additional test-folder?

Posted by Peter Schröder <ps...@blau.de>.
Hi,

I am experiencing a strange behavior of buildr when having an empty  
test-folder.

See the example in the attachment, and look into the readme.txt for  
the problem.

Kind regards
Peter


Re: Question about Organizing Directories for projects

Posted by Alex Boisvert <al...@gmail.com>.
Everything looks normal to me.

It's not compiling project-b:impl since there's no source files in it.

... but it's still packaging it as a :jar (with no .classes, just the jar
manifest)

alex


On Sun, Nov 1, 2009 at 4:13 PM, Babu Naidu <pb...@gmail.com> wrote:

> Thanks good to know. I have attached my project zip file that includes
> buildfile as well.
>
> When I do buildr in the root dir "tempbuildr",  I get the following build
> output. For some reason it is not compiling
> project-b's impl subproject.
>
> I am using buildr 1.3.4 (I went back from 1.3.5 to just to check) on Mac
> with JRuby.
>
> Thanks
> Babu
>
> buildr output
> ==============================================================
> pbns-MBP:tempbuildr pbn$ buildr
> (in /Users/pbn/home/dev/tempbuildr, development)
> Building tempbuildr
> mkdir -p /Users/pbn/home/dev/tempbuildr/project-a/api/target/classes
> Compiling tempbuildr:project-a:api into
> /Users/pbn/home/dev/tempbuildr/project-a/api/target/classes
> touch /Users/pbn/home/dev/tempbuildr/project-a/api/target/classes
> mkdir -p /Users/pbn/home/dev/tempbuildr/project-a/impl/target/classes
> Compiling tempbuildr:project-a:impl into
> /Users/pbn/home/dev/tempbuildr/project-a/impl/target/classes
> touch /Users/pbn/home/dev/tempbuildr/project-a/impl/target/classes
> mkdir -p /Users/pbn/home/dev/tempbuildr/project-b/api/target/classes
> Compiling tempbuildr:project-b:api into
> /Users/pbn/home/dev/tempbuildr/project-b/api/target/classes
> touch /Users/pbn/home/dev/tempbuildr/project-b/api/target/classes
> Completed in 0.837s
>
>
>
> On Sun, Nov 1, 2009 at 3:06 PM, lacton <la...@users.sourceforge.net>wrote:
>
>> Hi,
>>
>> Yes, you can use this directory structure.  In fact, that would be the
>> most conventional way of doing it.
>>
>> Could you show us more of the buildfile you are using?
>>
>> Lacton
>>
>> On Sat, Oct 31, 2009 at 4:40 AM, Babu Naidu <pb...@gmail.com> wrote:
>> > Hi,
>> >
>> > I am using 1.3.5 version of Buildr and I have following directory
>> structure.
>> >
>> > Root/
>> >     buildfile
>> >     /subporject-A
>> >              /the-api/src/main/java
>> >              /the-impl/src/main/java
>> >    /subproject-B
>> >
>> > My buildfile looks like
>> >
>> > define "Root" do
>> >    define "subproject-A"
>> >        define "the-api"
>> >            .....
>> >        end
>> >        define "the-impl"
>> >               .......
>> >        end
>> >    end
>> >    define "subject-B"
>> >          ........
>> >     end
>> > end
>> >
>> > Is it possible to organize like that? does it work? I tried, however
>> when I
>> > execute buildr at "Root", it only runs build for subproject-A/the-api
>> and
>> > stops.
>> > What am I doing wrong here?
>> >
>> > Any help is greatly appreciated.
>> >
>> > Thanks
>> > Babu
>> >
>>
>
>

Re: Question about Organizing Directories for projects

Posted by Babu Naidu <pb...@gmail.com>.
Thanks good to know. I have attached my project zip file that includes
buildfile as well.

When I do buildr in the root dir "tempbuildr",  I get the following build
output. For some reason it is not compiling
project-b's impl subproject.

I am using buildr 1.3.4 (I went back from 1.3.5 to just to check) on Mac
with JRuby.

Thanks
Babu

buildr output
==============================================================
pbns-MBP:tempbuildr pbn$ buildr
(in /Users/pbn/home/dev/tempbuildr, development)
Building tempbuildr
mkdir -p /Users/pbn/home/dev/tempbuildr/project-a/api/target/classes
Compiling tempbuildr:project-a:api into
/Users/pbn/home/dev/tempbuildr/project-a/api/target/classes
touch /Users/pbn/home/dev/tempbuildr/project-a/api/target/classes
mkdir -p /Users/pbn/home/dev/tempbuildr/project-a/impl/target/classes
Compiling tempbuildr:project-a:impl into
/Users/pbn/home/dev/tempbuildr/project-a/impl/target/classes
touch /Users/pbn/home/dev/tempbuildr/project-a/impl/target/classes
mkdir -p /Users/pbn/home/dev/tempbuildr/project-b/api/target/classes
Compiling tempbuildr:project-b:api into
/Users/pbn/home/dev/tempbuildr/project-b/api/target/classes
touch /Users/pbn/home/dev/tempbuildr/project-b/api/target/classes
Completed in 0.837s



On Sun, Nov 1, 2009 at 3:06 PM, lacton <la...@users.sourceforge.net> wrote:

> Hi,
>
> Yes, you can use this directory structure.  In fact, that would be the
> most conventional way of doing it.
>
> Could you show us more of the buildfile you are using?
>
> Lacton
>
> On Sat, Oct 31, 2009 at 4:40 AM, Babu Naidu <pb...@gmail.com> wrote:
> > Hi,
> >
> > I am using 1.3.5 version of Buildr and I have following directory
> structure.
> >
> > Root/
> >     buildfile
> >     /subporject-A
> >              /the-api/src/main/java
> >              /the-impl/src/main/java
> >    /subproject-B
> >
> > My buildfile looks like
> >
> > define "Root" do
> >    define "subproject-A"
> >        define "the-api"
> >            .....
> >        end
> >        define "the-impl"
> >               .......
> >        end
> >    end
> >    define "subject-B"
> >          ........
> >     end
> > end
> >
> > Is it possible to organize like that? does it work? I tried, however when
> I
> > execute buildr at "Root", it only runs build for subproject-A/the-api and
> > stops.
> > What am I doing wrong here?
> >
> > Any help is greatly appreciated.
> >
> > Thanks
> > Babu
> >
>