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

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

Reply via email to