buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Boisvert <>
Subject Re: bad error-reporting
Date Sun, 22 Nov 2009 16:42:07 GMT
On Sat, Nov 21, 2009 at 5:55 AM, Peter Schröder <> wrote:

> that's great!
> for additional information:
> we have lots of projects that we migrate to buildr and on that way we
> restructure them to have subprojects and to match the apache folder
> standard.
> so there is often the case that some sub projects misses a folder and so
> our standard tasks fail.
> it would be of great value if the failed task would print out its current
> scope so that one knows where to look for the missing source, or even that
> the problem is that there is something missing for packaging or compiling or
> whatever task is on its way...

As I explained, we now fail-fast so you'll get an error during project
definition, not later when the tasks are executing.

Adding a more explicit error about missing directories is difficult to do in
the general case because we opted for both "conventions over configurations"
and for automatically detecting what kind of project you're buildling (java,
groovy, scala, ...).   Without any indication, we don't really know what to
build so we can't provide meaningful error report.

I think your best bet is to write a simple extensions that checks for what
you're expecting, e.g.,

module JavaProject
  include Buildr::Extension

  before_define do |project|
    fail "Missing sources under src/main/java" unless File.exist?

  after_define do |project|
    project.package :jar if project.packages.size == 0

and in your Buildfile,

define 'foo' do
  extend JavaProject


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message