module Buildr::Extension::ClassMethods

Methods added to the extension module when including Extension.

Public Instance Methods

after_define(*args, &block) click to toggle source

This block is called once for the project with the project instance, right after running the project definition. You can use this to do any post-processing that depends on the project definition.

The block may be named and dependencies may be declared similar to Rake task dependencies:

after_define(:my_setup) do |project|
  # do stuff on project
end

# my_setup code must run before :compile (but only after project is defined)
after_define(:compile => :my_setup)
# File lib/buildr/core/project.rb, line 860
def after_define(*args, &block)
  if args.empty?
    name = self.name
    deps = []
  else
    name, args, deps = Buildr.application.resolve_args(args)
  end
  module_callbacks << Callback.new(:after_define, name, deps, block)
end
before_define(*args, &block) click to toggle source

This block is called once for the project with the project instance, right before running the project definition. You can use this to add tasks and set properties that will be used in the project definition.

The block may be named and dependencies may be declared similar to Rake task dependencies:

before_define(:my_setup) do |project|
  # do stuff on project
end

# my_setup code must run before :compile
before_define(:compile => :my_setup)
# File lib/buildr/core/project.rb, line 836
def before_define(*args, &block)
  if args.empty?
    name = self.name
    deps = []
  else
    name, args, deps = Buildr.application.resolve_args(args)
  end
  module_callbacks << Callback.new(:before_define, name, deps, block)
end
first_time(&block) click to toggle source

This block will be called once for any particular extension included in Project. You can use this to setup top-level and local tasks.

# File lib/buildr/core/project.rb, line 818
def first_time(&block)
  module_callbacks << Callback.new(:first_time, self.name, [], block)
end