remove some builder-tracked fields from the build_operation Hash
This commit is contained in:
parent
d047a1bf29
commit
935848c3b5
@ -1,12 +1,11 @@
|
||||
build do
|
||||
Environment.new do |env|
|
||||
env.add_builder(:Checker) do |params|
|
||||
target, sources, cache, env, vars = params.values_at(:target, :sources, :cache, :env, :vars)
|
||||
unless cache.up_to_date?(target, :Checker, sources, env)
|
||||
puts "Checker #{sources.first}" if env.echo != :off
|
||||
cache.register_build(target, :Checker, sources, env)
|
||||
unless @cache.up_to_date?(@target, :Checker, @sources, @env)
|
||||
puts "Checker #{@sources.first}" if @env.echo != :off
|
||||
@cache.register_build(@target, :Checker, @sources, @env)
|
||||
end
|
||||
target
|
||||
@target
|
||||
end
|
||||
env.Program("simple.exe", "simple.c")
|
||||
env.Checker(:checker, "simple.exe")
|
||||
|
@ -3,7 +3,7 @@ class ThreadedTestBuilder < Rscons::Builder
|
||||
command = ["ruby", "-e", %[sleep 1]]
|
||||
Rscons::ThreadedCommand.new(
|
||||
command,
|
||||
short_description: "ThreadedTestBuilder #{options[:target]}")
|
||||
short_description: "ThreadedTestBuilder #{@target}")
|
||||
end
|
||||
def finalize(options)
|
||||
true
|
||||
@ -12,9 +12,9 @@ end
|
||||
|
||||
class NonThreadedTestBuilder < Rscons::Builder
|
||||
def run(options)
|
||||
puts "NonThreadedTestBuilder #{options[:target]}"
|
||||
puts "NonThreadedTestBuilder #{@target}"
|
||||
sleep 1
|
||||
options[:target]
|
||||
@target
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
class MyBuilder < Rscons::Builder
|
||||
def run(options)
|
||||
env, target = options.values_at(:env, :target)
|
||||
env.print_builder_run_message("MyBuilder #{target}", "MyBuilder #{target} command")
|
||||
target
|
||||
@env.print_builder_run_message("MyBuilder #{@target}", "MyBuilder #{@target} command")
|
||||
@target
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -203,9 +203,8 @@ module Rscons
|
||||
# The target name on success or nil on failure.
|
||||
def standard_finalize(options)
|
||||
if options[:command_status]
|
||||
target, sources, cache, env = options.values_at(:target, :sources, :cache, :env)
|
||||
cache.register_build(target, options[:tc].command, sources, env)
|
||||
target
|
||||
@cache.register_build(@target, options[:tc].command, @sources, @env)
|
||||
@target
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -38,7 +38,6 @@ module Rscons
|
||||
def run(options)
|
||||
@vars["_TARGET"] = @target
|
||||
@vars["_SOURCES"] = @objects
|
||||
options[:sources] = @objects
|
||||
command = @env.build_command("${ARCMD}", @vars)
|
||||
standard_threaded_build("AR #{@target}", @target, command, @objects, @env, @cache)
|
||||
end
|
||||
@ -51,7 +50,10 @@ module Rscons
|
||||
# @return [String, nil]
|
||||
# The target name on success or nil on failure.
|
||||
def finalize(options)
|
||||
standard_finalize(options)
|
||||
if options[:command_status]
|
||||
@cache.register_build(@target, options[:tc].command, @objects, @env)
|
||||
@target
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -59,7 +59,6 @@ module Rscons
|
||||
@vars["_TARGET"] = @target
|
||||
@vars["_SOURCES"] = @objects
|
||||
@vars["LD"] = ld
|
||||
options[:sources] = @objects
|
||||
command = @env.build_command("${LDCMD}", @vars)
|
||||
standard_threaded_build("LD #{@target}", @target, command, @objects, @env, @cache)
|
||||
end
|
||||
@ -72,7 +71,10 @@ module Rscons
|
||||
# @return [String, nil]
|
||||
# The target name on success or nil on failure.
|
||||
def finalize(options)
|
||||
standard_finalize(options)
|
||||
if options[:command_status]
|
||||
@cache.register_build(@target, options[:tc].command, @objects, @env)
|
||||
@target
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -71,7 +71,6 @@ module Rscons
|
||||
@vars["_TARGET"] = @target
|
||||
@vars["_SOURCES"] = @objects
|
||||
@vars["SHLD"] = ld
|
||||
options[:sources] = @objects
|
||||
command = @env.build_command("${SHLDCMD}", @vars)
|
||||
standard_threaded_build("SHLD #{@target}", @target, command, @objects, @env, @cache)
|
||||
end
|
||||
@ -84,7 +83,10 @@ module Rscons
|
||||
# @return [String, nil]
|
||||
# The target name on success or nil on failure.
|
||||
def finalize(options)
|
||||
standard_finalize(options)
|
||||
if options[:command_status]
|
||||
@cache.register_build(@target, options[:tc].command, @objects, @env)
|
||||
@target
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -515,11 +515,7 @@ module Rscons
|
||||
builder.vars = @varset.merge(builder.vars)
|
||||
build_operation = {
|
||||
builder: builder,
|
||||
target: builder.target,
|
||||
sources: builder.sources,
|
||||
cache: cache,
|
||||
env: self,
|
||||
vars: builder.vars,
|
||||
}
|
||||
call_build_hooks = lambda do |sec|
|
||||
@build_hooks[sec].each do |build_hook_block|
|
||||
|
Loading…
x
Reference in New Issue
Block a user