bazel

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

README

Bazel interaction library

Copyright 2016 The Bazel Authors. All right reserved.

This library provides a Go API for interfacing with Bazel.

Sample usage:

Querying for all targets in the repo.

query := "//..."
b := bazel.New()
res, err := b.Query(query)
if err != nil {
  fmt.Printf("Error running Bazel %s\n", err)
}
for _, line := range res {
  fmt.Printf("Result: %s", line)
}

See the godoc for bazel.Query for more information.

Building a target in the repo.

target := "//path/to/your:target"
b := bazel.New()
err := b.Build(target)
if err != nil {
  fmt.Printf("Error running Bazel %s\n", err)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bazel

type Bazel interface {
	Args() []string
	SetArguments([]string)
	SetStartupArgs([]string)
	WriteToStderr(v bool)
	WriteToStdout(v bool)
	Info() (map[string]string, error)
	Query(args ...string) (*blaze_query.QueryResult, error)
	CQuery(args ...string) (*analysis.CqueryResult, error)
	Build(args ...string) (*bytes.Buffer, error)
	Test(args ...string) (*bytes.Buffer, error)
	Run(args ...string) (*exec.Cmd, *bytes.Buffer, error)
	Wait() error
	Cancel()
}

func New

func New() Bazel

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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