Class: Rscons::Builders::SimpleBuilder

Inherits:
Rscons::Builder show all
Defined in:
lib/rscons/builders/simple_builder.rb

Overview

A Generic builder class whose name and operation is defined at instantiation.

Since:

  • 1.8.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Rscons::Builder

#create_build_target, #default_variables, #features, #finalize, #produces?, #setup, #standard_build, #standard_finalize, #standard_threaded_build

Constructor Details

#initialize(name, &block) ⇒ SimpleBuilder

Create a new builder with the given name and action.

Since:

  • 1.8.0



18
19
20
21
# File 'lib/rscons/builders/simple_builder.rb', line 18

def initialize(name, &block)
  @name  = name.to_s
  @block = block
end

Instance Attribute Details

#nameString (readonly)

Returns The name of this builder.

Since:

  • 1.8.0



9
10
11
# File 'lib/rscons/builders/simple_builder.rb', line 9

def name
  @name
end

Instance Method Details

#run(target, sources, cache, env, vars) ⇒ String, false

Run the builder to produce a build target.

Since:

  • 1.8.0



33
34
35
# File 'lib/rscons/builders/simple_builder.rb', line 33

def run(target, sources, cache, env, vars)
  @block.call(target, sources, cache, env, vars)
end