Do not calculate checksums for side-effect files - #92
This commit is contained in:
parent
f23fbcd6d1
commit
87a15b3868
@ -238,11 +238,18 @@ module Rscons
|
|||||||
# @param options [Hash] Optional arguments.
|
# @param options [Hash] Optional arguments.
|
||||||
# @option options [Boolean] :install
|
# @option options [Boolean] :install
|
||||||
# Whether the target is for an install operation.
|
# Whether the target is for an install operation.
|
||||||
|
# @option options [Boolean] :side_effect
|
||||||
|
# Whether the target is a side-effect file (no checksum will be stored).
|
||||||
#
|
#
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def register_build(targets, command, deps, env, options = {})
|
def register_build(targets, command, deps, env, options = {})
|
||||||
Array(targets).each do |target|
|
Array(targets).each do |target|
|
||||||
target_checksum = Rscons.phony_target?(target) ? "" : calculate_checksum(target)
|
target_checksum =
|
||||||
|
if options[:side_effect] or Rscons.phony_target?(target)
|
||||||
|
""
|
||||||
|
else
|
||||||
|
calculate_checksum(target)
|
||||||
|
end
|
||||||
@cache["targets"][get_cache_key(target)] = {
|
@cache["targets"][get_cache_key(target)] = {
|
||||||
"command" => Digest::MD5.hexdigest(command.inspect),
|
"command" => Digest::MD5.hexdigest(command.inspect),
|
||||||
"checksum" => target_checksum,
|
"checksum" => target_checksum,
|
||||||
|
@ -620,7 +620,7 @@ module Rscons
|
|||||||
# Register side-effect files as build targets so that a Cache
|
# Register side-effect files as build targets so that a Cache
|
||||||
# clean operation will remove them.
|
# clean operation will remove them.
|
||||||
builder.side_effects.each do |side_effect|
|
builder.side_effects.each do |side_effect|
|
||||||
Cache.instance.register_build(side_effect, nil, [], self)
|
Cache.instance.register_build(side_effect, nil, [], self, side_effect: true)
|
||||||
@side_effects.delete(side_effect)
|
@side_effects.delete(side_effect)
|
||||||
end
|
end
|
||||||
@build_hooks[:post].each do |build_hook_block|
|
@build_hooks[:post].each do |build_hook_block|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user