BuildSourceBuildProvisionNode

class ProvisionNode

Represents a build graph node for applying a single provision within a dependency chain.

Definitions

def initialize(chain, provision, environment, arguments)

Initialize the provision node.

Signature

parameter chain Build::Dependency::Chain

The dependency chain.

parameter provision Build::Dependency::Provision

The provision to apply.

parameter environment Build::Environment

The root environment.

parameter arguments Array

Arguments passed down the build chain.

Implementation

def initialize(chain, provision, environment, arguments)
	@chain = chain
	@provision = provision
	@environment = environment
	@arguments = arguments
	
	# 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
		@provision == other.provision and
		@environment == other.environment and
		@arguments == other.arguments
end

def hash

Signature

returns Integer

A hash value for this node.

Implementation

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

def task_class(parent_task)

Signature

returns Class

The task class to use for this node.

Implementation

def task_class(parent_task)
	ProvisionTask
end

def name

Signature

returns String

The name of the provision.

Implementation

def name
	@provision.name
end

def dependency_node_for(dependency)

Build a class Build::DependencyNode for the given dependency.

Signature

parameter dependency Build::Dependency

The dependency to wrap.

returns Build::DependencyNode

The corresponding dependency node.

Implementation

def dependency_node_for(dependency)
	DependencyNode.new(@chain, dependency, @environment, @arguments)
end