/ build / workspace

Index | Files | Exmaples | Directories
go get


Package Files

local.go workspace.go


const (
    // BUILDFILE is the name of the file that keeps targets


var (
    // ErrNotAWorkspace is returned when the given URL is not a workspace
    ErrNotAWorkspace = errors.New("workspace: given url is not a workspace")
    // ErrNotAbsolute is returned when a url is not absolute
    ErrNotAbsolute = errors.New("workspace: local urls should be absolute paths")

func FindWorkspace

func FindWorkspace(a string, stat Stat) (string, error)

FindWorkspace looks for recursively for WORKSPACE file in each parent directory. If it fails to find anything it will return the fist directory with .git

A workspace is a directory on your filesystem that contains the source files for the software you want to build, as well as symbolic links to directories that contain the build outputs. Each workspace directory has a text file named WORKSPACE which may be empty, or may contain references to external dependencies required to build the outputs.

type Stat

type Stat func(string) (os.FileInfo, error)

Stat checks if a file exists or not in a workspace

type Workspace

type Workspace interface {
    AbsPath() string
    Buildfile(label.Label) string
    File(label.Label) string
    PackageDir(label.Label) string
    LoadBuildfile(label.Label) ([]byte, error)

Workspace is a Bazel workspace

func New

func New(a string) (Workspace, error)

New given a URL returns a workspace