bazel

package
v1.505.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: Apache-2.0 Imports: 32 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAspectVersions added in v1.501.3

func GetAspectVersions() ([]string, error)

func GetBazelVersions added in v1.501.3

func GetBazelVersions(bazelFork string) ([]string, error)

func InitializeStartupFlags added in v1.501.2

func InitializeStartupFlags(args []string) ([]string, []string, error)

Initializes start-up flags from args and returns args without start-up flags

func ParseOutBazelFlags added in v1.501.2

func ParseOutBazelFlags(command string, args []string) ([]string, []string, error)

Separates bazel flags from a list of arguments for the given bazel command. Returns the non-flag arguments & flag arguments as separate lists

func UserCacheDir added in v1.501.2

func UserCacheDir() (string, error)

Types

type Bazel

type Bazel interface {
	WithEnv(env []string) Bazel
	AQuery(expr string) (*analysis.ActionGraphContainer, error)
	MaybeReenterAspect(streams ioutils.Streams, args []string) (bool, int, error)
	RunCommand(streams ioutils.Streams, wd *string, command ...string) (int, error)
	InitializeBazelFlags() error
	Flags() (map[string]*flags.FlagInfo, error)
	AbsPathRelativeToWorkspace(relativePath string) (string, error)
	AddBazelFlags(cmd *cobra.Command) error
}
var NoWorkspaceRoot Bazel = &bazel{}

This is a special case where we run Bazel without a workspace (e.g., version).

var WorkspaceFromWd Bazel = findWorkspace()

func New

func New(workspaceRoot string) Bazel

type Bazelisk

type Bazelisk struct {

	// Set to true in getBazelVersion() if this aspect binary is not the user's configured
	// version and should re-enter another aspect binary of a different version
	AspectShouldReenter bool
	// contains filtered or unexported fields
}

func NewBazelisk

func NewBazelisk(workspaceRoot string) *Bazelisk

func (*Bazelisk) GetConfig added in v1.0.1

func (bazelisk *Bazelisk) GetConfig(name string) string

GetConfig reads a configuration value from .bazeliskrc.

func (*Bazelisk) GetEnvOrConfig

func (bazelisk *Bazelisk) GetEnvOrConfig(name string) string

GetEnvOrConfig reads a configuration value from the environment, but fall back to reading it from .bazeliskrc.

func (*Bazelisk) Run

func (bazelisk *Bazelisk) Run(args []string, repos *core.Repositories, streams ioutils.Streams, env []string, wd *string) (int, error)

Run runs the main Bazelisk logic for the given arguments and Bazel repositories.

type Output

type Output struct {
	Label    string
	Mnemonic string
	Path     string
}

func ParseOutputs

func ParseOutputs(agc *analysis.ActionGraphContainer) []Output

ParseOutputs reads the proto result of AQuery and extracts the output file paths with their generator mnemonics.

Directories

Path Synopsis
Package mock contains generated files.
Package mock contains generated files.
mock
Package mock contains generated files.
Package mock contains generated files.

Jump to

Keyboard shortcuts

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