BuildSourceBuildChainNode

class ChainNode

Responsible for processing a chain into a series of dependency nodes.

Definitions

def initialize(chain, arguments, environment)

Signature

parameter chain Chain

the chain to build.

parameter arguments Array

the arguments to pass to the output environment constructor.

parameter environment Build::Environment

the root environment to prepend into the chain.

Implementation

def initialize(chain, arguments, environment)
	@chain = chain
	@arguments = arguments
	@environment = environment
	
	# Wait here, for all dependent targets, to be done:
	super(Files::List::NONE, :inherit)
end

def ==(other)

Signature

returns Boolean

Whether this node is equal to another.

Implementation

def == other
	super and
		@chain == other.chain and
		@arguments == other.arguments and
		@environment == other.environment
end

def hash

Signature

returns Integer

A hash value for this node.

Implementation

def hash
	super ^ @chain.hash ^ @arguments.hash ^ @environment.hash
end

def task_class(parent_task)

Signature

returns Class

The task class to use for this node.

Implementation

def task_class(parent_task)
	Task
end

def name

Signature

returns String

The name of the environment.

Implementation

def name
	@environment.name
end

def apply!(task)

This is the main entry point when invoking the node from Build::Task.

Implementation

def apply!(task)
	# Go through all the dependencies in order and apply them to the build graph:
	@chain.dependencies.each do |dependency|
		task.invoke(
			DependencyNode.new(@chain, dependency, @environment, @arguments)
		)
	end
end

def inspect

Signature

returns String

A human-readable representation of this node.

Implementation

def inspect
	"#<#{self.class} #{@environment.inspect}>"
end