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