rename "tweakers" to "build hooks"
This commit is contained in:
1 parent
49be46199f
commit
243eb9a4ab
4 files changed
+17
-17
No files matched your search
@@ -22,7 +22,7 @@ module Rscons
|
||||
@targets = {}
|
||||
@builders = {}
|
||||
@build_dirs = []
|
||||
@tweakers = []
|
||||
@build_hooks = []
|
||||
@varset[:exclude_builders] ||= []
|
||||
unless @varset[:exclude_builders] == :all
|
||||
exclude_builders = Set.new(@varset[:exclude_builders] || [])
|
||||
@@ -43,7 +43,7 @@ module Rscons
|
||||
# Make a copy of the Environment object.
|
||||
# The cloned environment will contain a copy of all environment options,
|
||||
# construction variables, builders, and build directories. It will not
|
||||
# contain a copy of the targets or tweakers.
|
||||
# contain a copy of the targets or build hooks.
|
||||
# If a block is given, the Environment object is yielded to the block and
|
||||
# when the block returns, the {#process} method is automatically called.
|
||||
def clone(variables = {})
|
||||
@@ -72,9 +72,9 @@ module Rscons
|
||||
end
|
||||
end
|
||||
|
||||
# Add a tweaker block to the Environment.
|
||||
def add_tweaker(&block)
|
||||
@tweakers << block
|
||||
# Add a build hook to the Environment.
|
||||
def add_build_hook(&block)
|
||||
@build_hooks << block
|
||||
end
|
||||
|
||||
# Specify a build directory for this Environment.
|
||||
@@ -238,14 +238,14 @@ module Rscons
|
||||
# Return the result of the builder's run() method.
|
||||
def run_builder(builder, target, sources, cache, vars)
|
||||
vars = @varset.merge(vars)
|
||||
@tweakers.each do |tweaker_block|
|
||||
@build_hooks.each do |build_hook_block|
|
||||
build_operation = {
|
||||
builder: builder,
|
||||
target: target,
|
||||
sources: sources,
|
||||
vars: vars,
|
||||
}
|
||||
tweaker_block.call(build_operation)
|
||||
build_hook_block.call(build_operation)
|
||||
end
|
||||
builder.run(target, sources, cache, self, vars)
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user