Class Buildr::Layout
In: lib/buildr/core/project.rb  (CVS)
Parent: Object

Symbolic mapping for directory layout. Used for both the default and custom layouts.

For example, the default layout maps [:source, :main, :java] to ‘src/main/java’, and

:target, :main, :classes
to ‘target/classes’. You can use this to change the layout

of your projects.

To map [:source, :main] into the ‘sources’ directory:

  my_layout = Layout.new
  my_layout[:source, :main] = 'sources'

  define 'foo', :layout=>my_layout do
    ...
  end

To map [:source, :main, :java] to ‘java/main’:

  class MainLast < Layout
    def expand(*args)
      if args[0..1] == [:source, :main]
        super args[2], :main, *args[3,]
      else
        super
      end
    end
  end

  define 'foo', :layout=>MainLast do
    ...
  end

Methods

[]   []=   expand   initialize_copy  

Classes and Modules

Class Buildr::Layout::Default

Attributes

default  [RW]  Default layout used by new projects.

Public Instance methods

Resolves a list of symbols into a path.

Specifies the path resolved from a list of symbols.

Expands list of symbols and path names into a full path, for example:

  puts default.expand(:source, :main, :java)
  => "src/main/java"

[Validate]