buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject Layouts customized by project attributes
Date Fri, 19 Mar 2010 23:49:37 GMT

My current usage of buildr has resulted in many subprojects. Some of
these subprojects actually have no files as they simply repackaging
jars as OSGi bundles (i.e. jars + more metadata). So I have decided to
have a central "target" directory under which each project has a dir.
i.e. The following snippet uses target/A and target/B as intermediate
dirs of each project

class CentralLayout < Layout::Default
  def initialize(key, top_level = false)
    prefix = top_level ? '' : '../'
    self[:target] = "#{prefix}target/#{key}"
    self[:target, :main] = "#{prefix}target/#{key}"

define 'A', :layout =>'A', true) do
   define 'B', :layout =>'B') do

Unfortunately I have to repeat the name of the project when
constructing the layout. Is there any easy way to avoid this? The only
way that I could think of is to make it an extension which is overkill
atm (However I suspect by the time I reach the 20 or so subprojects it
may be worthwhile).

So is this the way you should do this sort of thing? Or any other suggestions?


Peter Donald

View raw message