update JobSet interface to just take a Hash of job parameters

This commit is contained in:
Josh Holtrop 2017-05-12 16:30:02 -04:00
parent 9cfc0c20b7
commit d46dc2014c
2 changed files with 14 additions and 13 deletions

View File

@ -400,7 +400,11 @@ module Rscons
sources: sources,
env: self,
vars: vars)
@job_set.add_job(builder, target, sources, vars)
@job_set.add_job(
builder: builder,
target: target,
sources: sources,
vars: vars)
end
# Manually record a given target as depending on the specified files.

View File

@ -11,26 +11,23 @@ module Rscons
# Add a job to the JobSet.
#
# @param target [Symbol, String]
# @param options [Hash]
# Options.
# @option options [Symbol, String] :target
# Build target name.
# @param builder [Builder]
# @option options [Builder] :builder
# The {Builder} to use to build the target.
# @param sources [Array<String>]
# @option options [Array<String>] :sources
# Source file name(s).
# @param vars [Hash]
# @option options [Hash] :vars
# Construction variable overrides.
def add_job(builder, target, sources, vars)
def add_job(options)
# We allow multiple jobs to be registered per target for cases like:
# env.Directory("dest")
# env.Install("dest", "bin")
# env.Install("dest", "share")
@jobs[target] ||= []
@jobs[target] << {
builder: builder,
target: target,
sources: sources,
vars: vars,
}
@jobs[options[:target]] ||= []
@jobs[options[:target]] << options
end
# Get the next job that is ready to run from the JobSet.