Class: Rscons::Builders::Command
- Inherits:
-
Rscons::Builder
- Object
- Rscons::Builder
- Rscons::Builders::Command
- Defined in:
- lib/rscons/builders/command.rb
Overview
A builder to execute an arbitrary 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 Attribute Summary
Attributes inherited from Rscons::Builder
#build_step, #cache, #env, #preferred_ld, #side_effects, #sources, #target, #vars
Instance Method Summary collapse
-
#run(options) ⇒ Object
Run the builder to produce a build target.
Methods inherited from Rscons::Builder
#depends, extra_path, #finalize_command, #initialize, name, #name, #nop?, #print_run_message, #produces, #register_command, #standard_command, #wait_for
Constructor Details
This class inherits a constructor from Rscons::Builder
Instance Method Details
#run(options) ⇒ Object
Run the builder to produce a build target.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rscons/builders/command.rb', line 12 def run() if @command finalize_command else @vars["_TARGET"] = @target @vars["_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_command("#{cmd_desc} <target>#{@target}<reset>", command, ) end end |