Class: Rscons::Builders::Command
- Inherits:
-
Rscons::Builder
- Object
- Rscons::Builder
- Rscons::Builders::Command
- Defined in:
- lib/rscons/builders/command.rb
Overview
Execute a command that will produce the given target based on the given sources.
Example:
env.Command("docs.html", "docs.md",
CMD => %w[pandoc -fmarkdown -thtml -o${_TARGET} ${_SOURCES}])
Instance Method Summary collapse
-
#finalize(options) ⇒ String?
Finalize a build.
-
#run(options) ⇒ String, ThreadedCommand
Run the builder to produce a build target.
Methods inherited from Rscons::Builder
#create_build_target, #default_variables, #features, #name, #produces?, #setup, #standard_build, #standard_finalize, #standard_threaded_build
Instance Method Details
#finalize(options) ⇒ String?
Finalize a build.
42 43 44 |
# File 'lib/rscons/builders/command.rb', line 42 def finalize() standard_finalize() end |
#run(options) ⇒ String, ThreadedCommand
Run the builder to produce a build target.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/rscons/builders/command.rb', line 20 def run() target, sources, cache, env, vars = .values_at(:target, :sources, :cache, :env, :vars) vars = vars.merge({ "_TARGET" => target, "_SOURCES" => sources, }) command = env.build_command("${CMD}", vars) cmd_desc = vars["CMD_DESC"] || "Command" = {} if vars["CMD_STDOUT"] [:stdout] = env.("${CMD_STDOUT}", vars) end standard_threaded_build("#{cmd_desc} #{target}", target, command, sources, env, cache, ) end |