Hey Rhett,

A big thanks for your support, the custom layout idea is now much clearer
for me. Once I changed the custom layout to include "src" as you suggested
things started looking a little more healthy but it's now unclear where the
compiled output is going, if it is being created at all. Here is my full
custom layout specification:

-----------
michel_layout = Layout.new
michel_layout[:source, :main, :java] = 'src'
michel_layout[:source, :test] = 'test'
michel_layout[:target, :main] = 'bin'
michel_layout[:target, :test] = 'bin'
-----------

I expected that I would end up with a bunch of .class files in the bin
directory but that doesn't happen as you can see below.

-----------
C:\Documents and Settings\mac\Eclipse Workspace\Jamie's Robot>buildr
compile --trace
C:/Program
Files/Ruby186/lib/ruby/gems/1.8/gems/buildr-1.4.6-x86-mswin32/lib/buildr/java/packaging.rb:62:
warning: parenthesize argument(s) for future
(in C:/Documents and Settings/mac/Eclipse Workspace/Jamie's Robot,
development)
** Invoke Jamie's Robot (first_time)
** Execute Jamie's Robot
** Invoke Jamie's Robot
** Invoke compile (first_time)
** Execute compile
Compiling Jamie's Robot
** Invoke Jamie's Robot:compile (first_time, not_needed)
** Invoke Jamie's Robot:resources (first_time)
** Execute Jamie's Robot:resources
Completed in 0.016s

C:\Documents and Settings\mac\Eclipse Workspace\Jamie's Robot>dir
 Volume in drive C has no label.
 Volume Serial Number is 0C6D-B07F

 Directory of C:\Documents and Settings\mac\Eclipse Workspace\Jamie's Robot

01/25/2012  11:11 AM    <DIR>          .
01/25/2012  11:11 AM    <DIR>          ..
01/13/2012  03:57 PM             1,770 .classpath
01/10/2012  08:18 AM               382 .project
01/13/2012  02:39 PM    <DIR>          .settings
01/25/2012  11:10 AM               630 buildfile
01/13/2012  03:57 PM    <DIR>          lib
01/13/2012  05:16 PM    <DIR>          src
01/13/2012  02:39 PM    <DIR>          test
01/13/2012  02:39 PM    <DIR>          testData
               3 File(s)          2,782 bytes
               7 Dir(s)  21,135,548,416 bytes free
----------

I noticed the line "Invoke Jamie's Robot:compile (first_time, not_needed)".
Does the "not needed" imply that buldr thinks that the compile is already
up to date and therefore does not need to be done this time round? The bin
directory does not exist, so I would expect a full re-compile.

Kind regards,

Mark

On 24 January 2012 18:43, Rhett Sutphin <rh...@detailedbalance.net> wrote:

> Hi,
>
> On Jan 24, 2012, at 11:37 AM, Rhett Sutphin wrote:
>
> > Hi Mark,
> >
> > On Jan 24, 2012, at 7:50 AM, Mark - Mixtup wrote:
> >
> >> Hello,
> >>
> >> I apologise in advance if this question is a little too basic. I have no
> >> experience with Ant or Maven which I assume would have helped me in
> getting
> >> started with buildr. I just got buildr installed and I'm struggling to
> get
> >> anything building. I have a non default layout which looks like this:
> >>
> >> *\src\com\ud\robots\<.java files>*
> >> *\src\com\ud\robots\assertions\<.java files>*
> >> *\src\com\ud\robots\carriers\<.java files> *
> >> *\src\com\ud\robots\functional\<.java files> *
> >> *\src\com\ud\robots\trigger\<.java files> *
> >
> > Looking at this listing, it seems like what you have is a single source
> directory (src) that contains code in five java packages (com.ud.robots,
> com.ud.assertions, com.ud.carriers, etc.). Unless you're sure you want to
> compile each package into a separate jar, what you want is
>
> Typo fix, just to be extra clear: the packages appear to be com.ud.robots,
> com.ud.robots.assertions, com.ud.robots.carriers, etc.
>
> Rhett
>
> >
> > custom_layout[:source, :main, :java] = 'src'
> >
> >>
> >> First I assumed that if I placed the buildfile in \ and then edited the
> >> layouts like this...
> >>
> >> *custom_layout[:source, :main, :java] = 'src/com/ud/robots'*
> >> *
> >> custom _layout[:source, :test] = 'test'
> >> custom _layout[:target, :main] = 'bin'
> >> custom _layout[:target, :test] = 'bin'
> >> *
> >>
> >> ...and then added the following in the main define...
> >>
> >> *compile.from _(:src, :main, :java)*
> >
> > If you change the layout for the project, you shouldn't need to use
> compile.from -- the default will work. If you do want to use compile.from,
> you want to say
> >
> > compile.from _(:source, :main, :java)
> >
> > for the path_to (underscore) method to use the values from your layout.
> >
> >>
> >> the build would work, but instead I get the following error...
> >>
> >> *Exception while invoking prerequisites of task <Buildr::CompileTask
> >> Jamie's Robot:compile => [Jamie's Robot:resources, C:/Documents and
> >> Settings/mac/Eclipse Workspace/Jamie's Robot/src/main/java]>*
> >> *
> >> *
> >> So now I have two questions:
> >>
> >> 1. Do I need to manually define the resources task? If so, could you
> point
> >> me to an example?
> >
> > There should be a resources task already. The part of the error you've
> copied here doesn't indicate what the actual problem was, just that there
> was a problem. My guess based on what you said above is that the source
> directory the error message is referring to (C:/Documents and
> Settings/mac/Eclipse Workspace/Jamie's Robot/src/main/java) doesn't exist.
> >
> > If my other suggestions don't work, please try to invoke buildr with the
> --trace option and send us the full output.
> >
> >> 2. Will having one central buildfile like this work, or do I need to
> have a
> >> separate one in each subdirectory as well as the root?
> >
> > If you really want to compile each java package separately, you will
> need to have multiple subprojects in a single buildfile. However, like I
> indicated above, please make sure that's really what you want.
> >
> > Rhett
> >
> >>
> >> Kind regards,
> >>
> >> Mark Coleman
>
>


-- 
---
Mark Coleman - +31(0)652134960 - Mixtup <http://www.mixtup.nl>
[image: 
Facebook]<http://www.facebook.com/pages/The-Mixtup-Project/161049465955>[image:
Youtube] <http://www.youtube.com/user/MixTupMovies>[image:
Vimeo]<http://vimeo.com/user4061445/videos>

Reply via email to