diff --git a/lib/rscons.rb b/lib/rscons.rb index 2ef06d0..02f6e0e 100644 --- a/lib/rscons.rb +++ b/lib/rscons.rb @@ -3,6 +3,7 @@ require_relative "rscons/builder" require_relative "rscons/cache" require_relative "rscons/environment" require_relative "rscons/job_set" +require_relative "rscons/threaded_command" require_relative "rscons/varset" require_relative "rscons/version" diff --git a/lib/rscons/threaded_command.rb b/lib/rscons/threaded_command.rb new file mode 100644 index 0000000..e885d50 --- /dev/null +++ b/lib/rscons/threaded_command.rb @@ -0,0 +1,31 @@ +module Rscons + # If a builder returns an instance of this class from its #run method, then + # Rscons will execute the command specified in a thread and allow other + # builders to continue executing in parallel. + class ThreadedCommand + + # @return [Array] + # The command to execute. + attr_reader :command + + # @return [Object] + # Arbitrary object to store builder-specific info. This object value will + # be passed back into the builder's #finalize method. + attr_reader :builder_info + + # Create a ThreadedCommand object. + # + # @param command [Array] + # The command to execute. + # @param options [Hash] + # Optional parameters. + # @option options [Object] :builder_info + # Arbitrary object to store builder-specific info. This object value will + # be passed back into the builder's #finalize method. + def initialize(command, options = {}) + @command = command + @builder_info = options[:builder_info] + end + + end +end