You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@buildr.apache.org by Miau Meow <mi...@gmail.com> on 2009/04/25 12:35:03 UTC

eclipse and target directories

Hi buildr-dev!

Firstly, buildr is awesome.  We recently switched our project from having a
handmade .classpath and .project to using buildr eclipse.  We have about 15
developers using eclipse and about 5 using IDEA.  The IDEA guys had been
using buildr idea/idea7x all along.

One thing that displeases me personally is that buildr eclipse sets the
output directory to the same target as what buildr uses.  I would prefer
these to be separate.  i.e. have a different layout for eclipse than for the
buildr command.  (I also wanted main, test, classes and resources in the
same place, mainly for historical reasons.)

The following task does what I want:

task :bin_target do
  projects.each do |project|
    bin_target=project.compile.target.to_s.sub(/target\/classes/, "bin")
    project.compile.into(bin_target)
    project.test.compile.into(bin_target)
    project.resources.filter.into(bin_target)
    project.test.resources.filter.into(bin_target)
  end
end

task :eclipse => :bin_target

Another thing that I noticed is that there is no obvious way to view the top
level directory in eclipse.  I would essentially want to see all the files
that are not part of any of the subprojects, including buildfile.  This
would roughly correspond to a maven2 parent project.

We went around that by creating a directory "super" which contains the top
level stuff.  The buildfile is called buildfile.rb, it specifies
Buildr.application.options.rakelib="/super".   The actual buildfile in the
toplevel directory just says:

require "super/buildfile"

The super project contains a hand crafted .project file stored in version
control, which is essentially empty except for the name of the project.

Br,
Tuomas