class DependencyNode
Represents a build graph node for resolving and building a single dependency.
Definitions
def initialize(chain, dependency, environment, arguments)
Initialize the dependency node.
Signature
-
parameter
chainBuild::Dependency::Chain The dependency chain.
-
parameter
dependencyBuild::Dependency The dependency to resolve.
-
parameter
environmentBuild::Environment The root environment.
-
parameter
argumentsArray Arguments passed down the build chain.
Implementation
def initialize(chain, dependency, environment, arguments)
@chain = chain
@dependency = dependency
@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
@dependency == other.dependency 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 ^ @dependency.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)
DependencyTask
end
def name
Signature
-
returns
String The name of the dependency.
Implementation
def name
@dependency.name
end
def provisions
Signature
-
returns
Array The provisions resolved for this dependency.
Implementation
def provisions
@chain.resolved[@dependency]
end
def public?
Signature
-
returns
Boolean Whether this dependency is public.
Implementation
def public?
@dependency.public?
end
def provision_node_for(provision)
Build a class Build::ProvisionNode for the given provision.
Signature
-
parameter
provisionBuild::Dependency::Provision The provision to wrap.
-
returns
Build::ProvisionNode The corresponding provision node.
Implementation
def provision_node_for(provision)
ProvisionNode.new(@chain, provision, @environment, @arguments)
end