Documentation ¶
Overview ¶
Package wspace provides a method to find the root of the bazel tree.
Index ¶
- func Find(dir string, rootFiles map[string]func(os.FileInfo) bool) (string, error)
- func FindRepoBuildFiles(root string) (map[string]string, error)
- func FindWorkspaceRoot(rootDir string) (root string, rest string)
- func IsRegularFile(path string) bool
- func SplitFilePath(filename string) (workspaceRoot, pkg, label string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Find ¶
Find searches from the given dir and up for the file that satisfies a condition of `rootFiles` returning the directory containing it, or an error if none found in the tree.
func FindRepoBuildFiles ¶
FindRepoBuildFiles parses the WORKSPACE to find BUILD files for non-Bazel external repositories, specifically those defined by one of these rules:
git_repository(), new_local_repository(), new_http_archive()
func FindWorkspaceRoot ¶
FindWorkspaceRoot splits the current code context (the rootDir if present, the working directory if not.) It returns the path of the directory containing the WORKSPACE file, and the rest.
func IsRegularFile ¶
IsRegularFile returns true if the path refers to a regular file after following symlinks.
func SplitFilePath ¶
SplitFilePath splits a file path into the workspace root, package name and label. Workspace root is determined as the last directory in the file path that contains a WORKSPACE (or WORKSPACE.bazel) file. Package and label are always separated with forward slashes. Returns empty strings if no WORKSPACE file is found.
Types ¶
This section is empty.