build: bldy.build/build/graph Index | Files

package graph

import "bldy.build/build/graph"

Package graph parses and generates build graphs

Index

Package Files

graph.go hash.go node.go

type ByName Uses

type ByName []*Node

ByName sorts dependencies by name so we can have reproduceable builds.

func (ByName) Len Uses

func (a ByName) Len() int

func (ByName) Less Uses

func (a ByName) Less(i, j int) bool

func (ByName) Swap Uses

func (a ByName) Swap(i, j int)

type Graph Uses

type Graph struct {
    Root *Node

    Nodes map[string]*Node
    // contains filtered or unexported fields
}

Graph represents a build graph

func New Uses

func New(wd, target string) (*Graph, error)

New returns a new build graph relatvie to the working directory

func (*Graph) Workspace Uses

func (g *Graph) Workspace() workspace.Workspace

Workspace returns the Workspace in which this graph exists.

type Node Uses

type Node struct {
    IsRoot        bool       `json:"-"`
    Target        build.Rule `json:"-"`
    Type          string
    Parents       map[string]*Node `json:"-"`
    Label         label.Label
    Worker        string
    PriorityCount int
    WG            sync.WaitGroup
    Status        build.Status
    Cached        bool
    Start, End    int64
    Hash          string
    Output        string `json:"-"`
    Once          sync.Once
    sync.Mutex
    Children map[string]*Node
    // contains filtered or unexported fields
}

Node encapsulates a target and represents a node in the build graph.

func NewNode Uses

func NewNode(l label.Label, t build.Rule) Node

NewNode takes a label and a rule and returns it as a Graph Node

func (*Node) HashNode Uses

func (n *Node) HashNode() []byte

HashNode calculates the hash of a node

func (*Node) Priority Uses

func (n *Node) Priority() int

Priority counts how many nodes directly and indirectly depend on this node

Package graph imports 14 packages (graph) and is imported by 3 packages. Updated 2018-10-01. Refresh now. Tools for package owners.