bazel

package
v0.0.0-...-ba6763d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Absolute path to bazel workspace
	WorkspaceRoot string
)

Functions

func CalcTargetHashes

func CalcTargetHashes(universe []string) (map[string]uint32, error)

CalcTargetHashes returns a map of (target name) -> (target hash) for all dependencies of the named universe (such as `//...`). If the hash changes for a given target, it is assumed that the target was affected by some change.

Types

type TargetNode

type TargetNode struct {
	Hash *uint32
	Deps []*TargetNode
	*bpb.Target
}

TargetNode wraps a Target proto message with a hash code and a list of dependent TargetNodes.

func (*TargetNode) GetDeps

func (n *TargetNode) GetDeps() []string

func (*TargetNode) GetHash

func (n *TargetNode) GetHash() uint32

GetHash returns a hash for the given TargetNode. If this hash changes, it is assumed that the corresponding Target was affected by some change. Targets are affected if source file contents change, or if rules' attributes or dependent targets change. Since dependent target changes are detected by changes in their respective hashes, GetHash will call GetHash on dependencies recursively down the build graph.

func (*TargetNode) GetName

func (n *TargetNode) GetName() string

GetName fetches the target name, which is in one of a few embedded messages depending on the target type.

func (*TargetNode) String

func (n *TargetNode) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL